diff mbox series

[FFmpeg-devel,272/279] lavf: Add non diegetic stream disposition flag

Message ID 20211208010649.381-27-jamrial@gmail.com
State New
Headers show
Series New channel layout API | expand

Commit Message

James Almer Dec. 8, 2021, 1:06 a.m. UTC
From: Vittorio Giovara <vittorio.giovara@gmail.com>

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/avformat.h | 7 +++++++
 libavformat/dump.c     | 2 ++
 2 files changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 75699f3a32..907cf9d7c6 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -872,6 +872,13 @@  typedef struct AVIndexEntry {
  */
 #define AV_DISPOSITION_TIMED_THUMBNAILS     (1 << 11)
 
+/**
+ * The stream is intended to be mixed with a spatial audio track. For example,
+ * it could be used for narration or stereo music, and may remain unchanged by
+ * listener head rotation.
+ */
+#define AV_DISPOSITION_NON_DIEGETIC         (1 << 12)
+
 /**
  * The subtitle stream contains captions, providing a transcription and possibly
  * a translation of audio. Typically intended for hearing-impaired audiences.
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 69b838fbc7..e3f0056c20 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -618,6 +618,8 @@  static void dump_stream_format(const AVFormatContext *ic, int i,
         av_log(NULL, AV_LOG_INFO, " (dependent)");
     if (st->disposition & AV_DISPOSITION_STILL_IMAGE)
         av_log(NULL, AV_LOG_INFO, " (still image)");
+    if (st->disposition & AV_DISPOSITION_NON_DIEGETIC)
+        av_log(NULL, AV_LOG_INFO, " (non-diegetic)");
     av_log(NULL, AV_LOG_INFO, "\n");
 
     dump_metadata(NULL, st->metadata, "    ");