diff mbox series

[FFmpeg-devel,v2,1/1] avformat/dump: Print stream start offsets for input streams

Message ID BN0P223MB0358E950612B3425DBC2F536BA629@BN0P223MB0358.NAMP223.PROD.OUTLOOK.COM
State New
Headers show
Series [FFmpeg-devel,v2,1/1] avformat/dump: Print stream start offsets for input streams | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Soft Works Nov. 25, 2021, 3:35 a.m. UTC
Signed-off-by: softworkz <softworkz@hotmail.com>
---
v2: Removed the level output as there doesn't appear to exist a convenient 
way for getting a string representation for a level id (for arbitrary codecs).
The stream offsets are the more interesting part of this anyway.

 libavformat/dump.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/dump.c b/libavformat/dump.c
index 4824965ee9..427478426f 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -577,6 +577,11 @@  static void dump_stream_format(const AVFormatContext *ic, int i,
             print_fps(1 / av_q2d(st->time_base), "tbn");
     }
 
+    if (st->start_time != AV_NOPTS_VALUE && st->start_time != 0 && st->time_base.den && st->time_base.num) {
+        const double stream_start = st->start_time * av_q2d(st->time_base);
+        av_log(NULL, AV_LOG_INFO, ", Start-Time %.3fs", stream_start);
+    }
+
     if (st->disposition & AV_DISPOSITION_DEFAULT)
         av_log(NULL, AV_LOG_INFO, " (default)");
     if (st->disposition & AV_DISPOSITION_DUB)