[FFmpeg-cvslog] Use audio_service_type to set stream disposition.

Justin Ruggles git at videolan.org
Sat Mar 26 03:10:00 CET 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Thu Mar 24 12:09:02 2011 -0400| [c70a6a41ddb759a5c6e8e810ebd603e39c36a315] | committer: Justin Ruggles

Use audio_service_type to set stream disposition.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c70a6a41ddb759a5c6e8e810ebd603e39c36a315
---

 libavformat/utils.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 8c0bf77..7ece078 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;
+            }
         }
     }
 




More information about the ffmpeg-cvslog mailing list