diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2004-12-03 15:34:19 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2004-12-03 15:34:19 +0000 |
commit | 461861f3debcfa74c48915144fa19801fb61b35d (patch) | |
tree | bd3203cc539709ec6fdb3269907f92e0ea60b735 /ext/faad | |
parent | 3c99555b67f703844bfad4b1ba8073dc44865e33 (diff) | |
download | gst-plugins-bad-461861f3debcfa74c48915144fa19801fb61b35d.tar.gz gst-plugins-bad-461861f3debcfa74c48915144fa19801fb61b35d.tar.bz2 gst-plugins-bad-461861f3debcfa74c48915144fa19801fb61b35d.zip |
ext/faad/gstfaad.c: Set DURATION even if source buffer didn't. Also use increasing timestamps.
Original commit message from CVS:
* ext/faad/gstfaad.c: (gst_faad_chanpos_from_gst),
(gst_faad_chanpos_to_gst), (gst_faad_chain):
Set DURATION even if source buffer didn't. Also use increasing
timestamps.
* gst-libs/gst/riff/riff-media.c:
(gst_riff_create_audio_caps_with_data):
Block_align can have larger values than 8192.
Diffstat (limited to 'ext/faad')
-rw-r--r-- | ext/faad/gstfaad.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ext/faad/gstfaad.c b/ext/faad/gstfaad.c index aa03a4e6..c5b900cf 100644 --- a/ext/faad/gstfaad.c +++ b/ext/faad/gstfaad.c @@ -192,6 +192,7 @@ gst_faad_chanpos_from_gst (GstAudioChannelPosition * pos, guint num) fpos[n] = FRONT_CHANNEL_RIGHT; break; case GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER: + case GST_AUDIO_CHANNEL_POSITION_FRONT_MONO: fpos[n] = FRONT_CHANNEL_CENTER; break; case GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT: @@ -238,7 +239,11 @@ gst_faad_chanpos_to_gst (guchar * fpos, guint num) pos[n] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT; break; case FRONT_CHANNEL_CENTER: - pos[n] = GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER; + /* argh, mono = center */ + if (num == 1) + pos[n] = GST_AUDIO_CHANNEL_POSITION_FRONT_MONO; + else + pos[n] = GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER; break; case SIDE_CHANNEL_LEFT: pos[n] = GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT; @@ -539,6 +544,7 @@ gst_faad_chain (GstPad * pad, GstData * data) GstFaad *faad = GST_FAAD (gst_pad_get_parent (pad)); GstBuffer *buf, *outbuf; faacDecFrameInfo *info; + guint64 next_ts; void *out; if (GST_IS_EVENT (data)) { @@ -563,6 +569,7 @@ gst_faad_chain (GstPad * pad, GstData * data) /* buffer + remaining data */ buf = GST_BUFFER (data); + next_ts = GST_BUFFER_TIMESTAMP (buf); if (faad->tempbuf) { buf = gst_buffer_join (faad->tempbuf, buf); faad->tempbuf = NULL; @@ -644,9 +651,10 @@ gst_faad_chain (GstPad * pad, GstData * data) outbuf = gst_buffer_new_and_alloc (info->samples * faad->bps); /* ugh */ memcpy (GST_BUFFER_DATA (outbuf), out, GST_BUFFER_SIZE (outbuf)); - GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf); - GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (buf); - + GST_BUFFER_TIMESTAMP (outbuf) = next_ts; + GST_BUFFER_DURATION (outbuf) = + (guint64) GST_SECOND *info->samples / faad->samplerate; + next_ts += GST_BUFFER_DURATION (outbuf); gst_pad_push (faad->srcpad, GST_DATA (outbuf)); } } |