summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2008-11-04 18:53:01 +0000
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2008-11-04 18:53:01 +0000
commit51e0b9b509e79f54400662c078d20faffa00306a (patch)
treed7afc8ebbabcd7cc5ac286f34340aced97f68ab2
parent0165bad2a803c193fb252466290e7de8bd808001 (diff)
downloadgst-libav-51e0b9b509e79f54400662c078d20faffa00306a.tar.gz
ext/ffmpeg/gstffmpegcodecmap.c: Fix regression in template caps limitations; expose more than 2 channels in both src ...
Original commit message from CVS: * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new): Fix regression in template caps limitations; expose more than 2 channels in both src and sink template if so supported.
-rw-r--r--ChangeLog7
-rw-r--r--ext/ffmpeg/gstffmpegcodecmap.c23
2 files changed, 22 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 05de4d5..dd0e4fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-11-04 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
+
+ * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new):
+ Fix regression in template caps limitations;
+ expose more than 2 channels in both src and sink template
+ if so supported.
+
2008-11-04 Stefan Kost <ensonic@users.sf.net>
* ext/ffmpeg/Makefile.am:
diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c
index 6319454..40a60b9 100644
--- a/ext/ffmpeg/gstffmpegcodecmap.c
+++ b/ext/ffmpeg/gstffmpegcodecmap.c
@@ -205,7 +205,7 @@ gst_ff_aud_caps_new (AVCodecContext * context, enum CodecID codec_id,
const gint *rates = NULL;
gint n_rates = 0;
- if (context)
+ if (context) {
/* so we must be after restricted caps in this particular case */
switch (codec_id) {
case CODEC_ID_MP2:
@@ -221,7 +221,6 @@ gst_ff_aud_caps_new (AVCodecContext * context, enum CodecID codec_id,
const static gint l_rates[] = { 48000, 44100, 32000 };
n_rates = G_N_ELEMENTS (l_rates);
rates = l_rates;
- maxchannels = 6;
break;
}
case CODEC_ID_ADPCM_SWF:
@@ -241,15 +240,23 @@ gst_ff_aud_caps_new (AVCodecContext * context, enum CodecID codec_id,
case CODEC_ID_ADPCM_G726:
maxchannels = 1;
break;
- case CODEC_ID_AAC:
- case CODEC_ID_DTS:
- /* Until decoders/encoders expose the maximum number of channels
- * they support, we whitelist them here. */
- maxchannels = 6;
- break;
default:
break;
}
+ }
+
+ /* regardless of encode/decode, open up channels if applicable */
+ /* Until decoders/encoders expose the maximum number of channels
+ * they support, we whitelist them here. */
+ switch (codec_id) {
+ case CODEC_ID_AC3:
+ case CODEC_ID_AAC:
+ case CODEC_ID_DTS:
+ maxchannels = 6;
+ break;
+ default:
+ break;
+ }
if (maxchannels == 1)
caps = gst_caps_new_simple (mimetype,