Commit 51e0b9b5 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts

ext/ffmpeg/gstffmpegcodecmap.c: Fix regression in template caps limitations;...

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.
parent 0165bad2
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:
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment