diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2008-11-04 18:53:01 +0000 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2008-11-04 18:53:01 +0000 |
commit | 51e0b9b509e79f54400662c078d20faffa00306a (patch) | |
tree | d7afc8ebbabcd7cc5ac286f34340aced97f68ab2 /ext/ffmpeg/gstffmpegcodecmap.c | |
parent | 0165bad2a803c193fb252466290e7de8bd808001 (diff) |
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.
Diffstat (limited to 'ext/ffmpeg/gstffmpegcodecmap.c')
-rw-r--r-- | ext/ffmpeg/gstffmpegcodecmap.c | 23 |
1 files changed, 15 insertions, 8 deletions
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, |