avformat/mpegts: set AV_DISPOSITION_DEPENDENT for mix_type=0 supplementary audio
authorAman Gupta <aman@tmm1.net>
Fri, 23 Feb 2018 21:38:33 +0000 (13:38 -0800)
committerAman Gupta <aman@tmm1.net>
Fri, 23 Feb 2018 21:47:29 +0000 (13:47 -0800)
Signed-off-by: Aman Gupta <aman@tmm1.net>
fftools/ffmpeg.c
libavformat/avformat.h
libavformat/dump.c
libavformat/mpegts.c

index a37de2f..bea922b 100644 (file)
@@ -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 },
         };
index 4ea1b5a..a2fe7c6 100644 (file)
@@ -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.
index e20902c..942e62a 100644 (file)
@@ -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, "    ");
index bca7a7a..37a6aa8 100644 (file)
@@ -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;