[FFmpeg-devel] [PATCH] avformat/s337m: Use and test Dolby-E-parser

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Fri Mar 19 18:24:53 EET 2021


This makes av_read_frame() return packets with proper timestamps.
As a result, seeking now works in combination with streamcopy.
A FATE-test for this has been added.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavformat/s337m.c        |  1 +
 tests/fate/demux.mak       |  3 +++
 tests/ref/fate/s337m-demux | 31 +++++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)
 create mode 100644 tests/ref/fate/s337m-demux

diff --git a/libavformat/s337m.c b/libavformat/s337m.c
index 36e1047af8..9e3c8ed1ba 100644
--- a/libavformat/s337m.c
+++ b/libavformat/s337m.c
@@ -189,6 +189,7 @@ static int s337m_read_packet(AVFormatContext *s, AVPacket *pkt)
         }
         st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
         st->codecpar->codec_id   = codec;
+        st->need_parsing         = AVSTREAM_PARSE_HEADERS;
     }
 
     return 0;
diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
index e5809bedd4..e9b8aeec0f 100644
--- a/tests/fate/demux.mak
+++ b/tests/fate/demux.mak
@@ -133,6 +133,9 @@ fate-qcp-demux: CMD = crc -i $(TARGET_SAMPLES)/qcp/0036580847.QCP -c:a copy
 FATE_SAMPLES_DEMUX-$(CONFIG_R3D_DEMUXER) += fate-redcode-demux
 fate-redcode-demux: CMD = framecrc -i $(TARGET_SAMPLES)/r3d/4MB-sample.r3d -c:v copy -c:a copy
 
+FATE_SAMPLES_DEMUX-$(call ALLYES, S337M_DEMUXER DOLBY_E_PARSER FRAMECRC_MUXER) += fate-s337m-demux
+fate-s337m-demux: CMD = framecrc -i $(TARGET_SAMPLES)/dolby_e/16-11 -c copy -ss 2 -t 1
+
 FATE_SAMPLES_DEMUX-$(CONFIG_SIFF_DEMUXER) += fate-siff-demux
 fate-siff-demux: CMD = framecrc -i $(TARGET_SAMPLES)/SIFF/INTRO_B.VB -c copy
 
diff --git a/tests/ref/fate/s337m-demux b/tests/ref/fate/s337m-demux
new file mode 100644
index 0000000000..2857c65aee
--- /dev/null
+++ b/tests/ref/fate/s337m-demux
@@ -0,0 +1,31 @@
+#tb 0: 1/90000
+#media_type 0: audio
+#codec_id 0: dolby_e
+#sample_rate 0: 44800
+#channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
+0,          0,          0,     3600,     7664, 0x7e73f2fd
+0,       3600,       3600,     3600,     7664, 0x8b980ec8
+0,       7200,       7200,     3600,     7664, 0xa16adbd5
+0,      10800,      10800,     3600,     7664, 0x6d1b43a5
+0,      14400,      14400,     3600,     7664, 0xb7e52e2a
+0,      18000,      18000,     3600,     7664, 0xcb7d6463
+0,      21600,      21600,     3600,     7664, 0x148a557b
+0,      25200,      25200,     3600,     7664, 0x04c0142e
+0,      28800,      28800,     3600,     7664, 0xf96de1d4
+0,      32400,      32400,     3600,     7664, 0x9f3224e0
+0,      36000,      36000,     3600,     7664, 0x6bd905cb
+0,      39600,      39600,     3600,     7664, 0xe6782023
+0,      43200,      43200,     3600,     7664, 0x983f5048
+0,      46800,      46800,     3600,     7664, 0x017df49a
+0,      50400,      50400,     3600,     7664, 0x25e605a9
+0,      54000,      54000,     3600,     7664, 0x764ef01e
+0,      57600,      57600,     3600,     7664, 0x3830f9f0
+0,      61200,      61200,     3600,     7664, 0xbcd62352
+0,      64800,      64800,     3600,     7664, 0x51ab1a35
+0,      68400,      68400,     3600,     7664, 0xc21ff964
+0,      72000,      72000,     3600,     7664, 0x9d6c0efa
+0,      75600,      75600,     3600,     7664, 0x5e55dd80
+0,      79200,      79200,     3600,     7664, 0xfd9eeb6d
+0,      82800,      82800,     3600,     7664, 0xcf86ce9d
+0,      86400,      86400,     3600,     7664, 0xc6e8319c
-- 
2.27.0



More information about the ffmpeg-devel mailing list