summaryrefslogtreecommitdiff
path: root/ext/ffmpeg/gstffmpegcodecmap.c
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2008-08-29 09:53:29 +0000
committerEdward Hervey <bilboed@bilboed.com>2008-08-29 09:53:29 +0000
commit459ba46c222669517b11badf64859c8bf5769a0d (patch)
treef7be2231367e17b31cae9696ee7f008b7c3bc215 /ext/ffmpeg/gstffmpegcodecmap.c
parent7d4c7bf635020ce6d13e6a9ae850e66df9aae074 (diff)
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
Diffstat (limited to 'ext/ffmpeg/gstffmpegcodecmap.c')
-rw-r--r--ext/ffmpeg/gstffmpegcodecmap.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c
index b25cdb9..8046737 100644
--- a/ext/ffmpeg/gstffmpegcodecmap.c
+++ b/ext/ffmpeg/gstffmpegcodecmap.c
@@ -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);
}