[3/3] movenc-test: Add tests for negative cts offsets

Message ID 20170219212217.80933-3-martin@martin.st
State Superseded
Headers show

Commit Message

Martin Storsjö Feb. 19, 2017, 9:22 p.m.
---
 libavformat/tests/movenc.c | 19 +++++++++++++++++++
 tests/ref/fate/movenc      | 11 +++++++++++
 2 files changed, 30 insertions(+)

Patch

diff --git a/libavformat/tests/movenc.c b/libavformat/tests/movenc.c
index 583a8d9..f2aa662 100644
--- a/libavformat/tests/movenc.c
+++ b/libavformat/tests/movenc.c
@@ -741,6 +741,25 @@  int main(int argc, char **argv)
     clear_duration = 0;
     do_interleave = 0;
 
+    // Write a fragmented file with b-frames and audio preroll,
+    // with negative cts values, removing the edit list for the
+    // video track.
+    init_out("delay-moov-elst-neg-cts");
+    av_dict_set(&opts, "movflags", "frag_keyframe+delay_moov+negative_cts_offsets", 0);
+    init(1, 1);
+    mux_gops(2);
+    finish();
+    close_out();
+
+    // Write a fragmented file with b-frames without audio preroll,
+    // with negative cts values, avoiding any edit lists, allowing
+    // to use empty_moov instead of delay_moov.
+    init_out("empty-moov-neg-cts");
+    av_dict_set(&opts, "movflags", "frag_keyframe+empty_moov+negative_cts_offsets", 0);
+    init(1, 0);
+    mux_gops(2);
+    finish();
+    close_out();
 
     av_free(md5);
 
diff --git a/tests/ref/fate/movenc b/tests/ref/fate/movenc
index a0a1700..d6504ac 100644
--- a/tests/ref/fate/movenc
+++ b/tests/ref/fate/movenc
@@ -133,3 +133,14 @@  write_data len 476, time 1566667, type sync atom moof
 write_data len 340, time 2233333, type boundary atom moof
 write_data len 262, time nopts, type trailer atom -
 a4280bdc23af2c4334ec2da3fa946d3a 3541 vfr-noduration-interleave
+write_data len 1219, time nopts, type header atom ftyp
+write_data len 620, time 0, type sync atom moof
+write_data len 616, time 1000000, type sync atom moof
+write_data len 148, time nopts, type trailer atom -
+4c5b22acc450f885159fc6039617dac1 2603 delay-moov-elst-neg-cts
+write_data len 36, time nopts, type header atom ftyp
+write_data len 1147, time nopts, type header atom -
+write_data len 900, time 0, type sync atom moof
+write_data len 616, time 1033333, type sync atom moof
+write_data len 148, time nopts, type trailer atom -
+7b08009448dee645f56f2c98b2f3a598 2847 empty-moov-neg-cts