summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--ext/faad/gstfaad.c16
-rw-r--r--gst-libs/gst/riff/riff-media.c2
3 files changed, 23 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b45a97b..332e9f27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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):
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));
}
}
diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c
index 99aa9a03..4e4e22d3 100644
--- a/gst-libs/gst/riff/riff-media.c
+++ b/gst-libs/gst/riff/riff-media.c
@@ -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);
}
}