From c70a6a41ddb759a5c6e8e810ebd603e39c36a315 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Thu, 24 Mar 2011 12:09:02 -0400 Subject: [PATCH] Use audio_service_type to set stream disposition. --- libavformat/utils.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libavformat/utils.c b/libavformat/utils.c index 8c0bf77f35..7ece0787f3 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2445,6 +2445,19 @@ int av_find_stream_info(AVFormatContext *ic) }else if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if(!st->codec->bits_per_coded_sample) st->codec->bits_per_coded_sample= av_get_bits_per_sample(st->codec->codec_id); + // set stream disposition based on audio service type + switch (st->codec->audio_service_type) { + case AV_AUDIO_SERVICE_TYPE_EFFECTS: + st->disposition = AV_DISPOSITION_CLEAN_EFFECTS; break; + case AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED: + st->disposition = AV_DISPOSITION_VISUAL_IMPAIRED; break; + case AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED: + st->disposition = AV_DISPOSITION_HEARING_IMPAIRED; break; + case AV_AUDIO_SERVICE_TYPE_COMMENTARY: + st->disposition = AV_DISPOSITION_COMMENT; break; + case AV_AUDIO_SERVICE_TYPE_KARAOKE: + st->disposition = AV_DISPOSITION_KARAOKE; break; + } } }