[FFmpeg-cvslog] avformat/mpegts: set AV_DISPOSITION_DEPENDENT for mix_type=0 supplementary audio

Aman Gupta git at videolan.org
Fri Feb 23 23:47:48 EET 2018


ffmpeg | branch: master | Aman Gupta <aman at tmm1.net> | Fri Feb 23 13:38:33 2018 -0800| [4f40d64e009869441ee63dad00b41e0a5bf7634d] | committer: Aman Gupta

avformat/mpegts: set AV_DISPOSITION_DEPENDENT for mix_type=0 supplementary audio

Signed-off-by: Aman Gupta <aman at tmm1.net>

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

 fftools/ffmpeg.c       | 1 +
 libavformat/avformat.h | 1 +
 libavformat/dump.c     | 2 ++
 libavformat/mpegts.c   | 3 +++
 4 files changed, 7 insertions(+)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index a37de2ff98..bea922b0aa 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -3592,6 +3592,7 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
             { "clean_effects"       , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CLEAN_EFFECTS     },    .unit = "flags" },
             { "captions"            , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CAPTIONS          },    .unit = "flags" },
             { "descriptions"        , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DESCRIPTIONS      },    .unit = "flags" },
+            { "dependent"           , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DEPENDENT         },    .unit = "flags" },
             { "metadata"            , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_METADATA          },    .unit = "flags" },
             { NULL },
         };
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 4ea1b5ab72..a2fe7c6bb2 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -845,6 +845,7 @@ typedef struct AVStreamInternal AVStreamInternal;
 #define AV_DISPOSITION_CAPTIONS     0x10000
 #define AV_DISPOSITION_DESCRIPTIONS 0x20000
 #define AV_DISPOSITION_METADATA     0x40000
+#define AV_DISPOSITION_DEPENDENT    0x80000 ///< dependent audio stream (mix_type=0 in mpegts)
 
 /**
  * Options for behavior on timestamp wrap detection.
diff --git a/libavformat/dump.c b/libavformat/dump.c
index e20902ce85..942e62a581 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -549,6 +549,8 @@ static void dump_stream_format(AVFormatContext *ic, int i,
         av_log(NULL, AV_LOG_INFO, " (clean effects)");
     if (st->disposition & AV_DISPOSITION_DESCRIPTIONS)
         av_log(NULL, AV_LOG_INFO, " (descriptions)");
+    if (st->disposition & AV_DISPOSITION_DEPENDENT)
+        av_log(NULL, AV_LOG_INFO, " (dependent)");
     av_log(NULL, AV_LOG_INFO, "\n");
 
     dump_metadata(NULL, st->metadata, "    ");
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index bca7a7af4e..37a6aa8bff 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1904,6 +1904,9 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
                 return AVERROR_INVALIDDATA;
             flags = get8(pp, desc_end);
 
+            if ((flags & 0x80) == 0) /* mix_type */
+                st->disposition |= AV_DISPOSITION_DEPENDENT;
+
             switch ((flags >> 2) & 0x1F) { /* editorial_classification */
             case 0x01:
                 st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED;



More information about the ffmpeg-cvslog mailing list