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.
This commit is contained in:
Ronald S. Bultje 2004-12-03 15:34:19 +00:00
parent 3c99555b67
commit 461861f3de
3 changed files with 23 additions and 5 deletions

View file

@ -1,3 +1,13 @@
2004-12-03 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* 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.
2004-12-02 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/law/alaw-decode.c: (alawdec_getcaps), (alawdec_link):

View file

@ -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));
}
}

View file

@ -514,7 +514,7 @@ gst_riff_create_audio_caps_with_data (guint16 codec_id,
}
if (block_align) {
gst_caps_set_simple (caps,
"block_align", GST_TYPE_INT_RANGE, 1, 8192, NULL);
"block_align", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
}
}