aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-03-24 12:09:02 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-03-25 16:58:50 -0400
commitc70a6a41ddb759a5c6e8e810ebd603e39c36a315 (patch)
treeca2451faface4168153ee864cadb54ec69b259c0
parent0b18b49b3b7dace5c5840529600fcddbcebcf878 (diff)
downloadffmpeg-c70a6a41ddb759a5c6e8e810ebd603e39c36a315.tar.gz
Use audio_service_type to set stream disposition.
-rw-r--r--libavformat/utils.c13
1 files changed, 13 insertions, 0 deletions
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;
+ }
}
}