ext/ffmpeg/gstffmpegcodecmap.c: Instead of marking all audio decoders/encoders as accepting up to 6 channels, we whit...

Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new):
Instead of marking all audio decoders/encoders as accepting up to 6
channels, we white-list those for which we are sure they can handle
those 6 channels.
Fixes #549799
This commit is contained in:
Edward Hervey 2008-08-29 09:53:29 +00:00
parent 7d4c7bf635
commit 459ba46c22
2 changed files with 22 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2008-08-29 Edward Hervey <edward.hervey@collabora.co.uk>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new):
Instead of marking all audio decoders/encoders as accepting up to 6
channels, we white-list those for which we are sure they can handle
those 6 channels.
Fixes #549799
2008-08-28 Michael Smith <msmith@songbirdnest.com>
* ext/ffmpeg/gstffmpegdemux.c:

View file

@ -169,9 +169,22 @@ gst_ff_aud_caps_new (AVCodecContext * context, enum CodecID codec_id,
"rate", G_TYPE_INT, context->sample_rate,
"channels", G_TYPE_INT, context->channels, NULL);
} else {
gint maxchannels;
/* 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:
maxchannels = 2;
}
caps = gst_caps_new_simple (mimetype,
"rate", GST_TYPE_INT_RANGE, 8000, 96000,
"channels", GST_TYPE_INT_RANGE, 1, 6, NULL);
"channels", GST_TYPE_INT_RANGE, 1, maxchannels, NULL);
}