]> git.sesse.net Git - ffmpeg/commitdiff
movenc: Add a unit test for frag_discont with edit lists
authorMartin Storsjö <martin@martin.st>
Sat, 7 Nov 2015 21:55:32 +0000 (23:55 +0200)
committerMartin Storsjö <martin@martin.st>
Wed, 11 Nov 2015 20:52:53 +0000 (22:52 +0200)
This tests the case where the muxer correctly guesses that a stream
starts at pts=0.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/movenc-test.c
tests/ref/fate/movenc

index 20043b295ff14ad1c3ded34d2fe36721e97e629b..a549854fc1266720bef57ff8fa9836957222f4a0 100644 (file)
@@ -538,6 +538,40 @@ int main(int argc, char **argv)
     finish();
 
 
+    // Test discontinously written fragments with b-frames (where the
+    // assumption of starting at pts=0 works) but not with audio preroll
+    // (which can't be guessed).
+    av_dict_set(&opts, "movflags", "frag_custom+delay_moov+dash", 0);
+    init(1, 0);
+    mux_gops(1);
+    init_out("delay-moov-elst-init");
+    av_write_frame(ctx, NULL); // Output the moov
+    close_out();
+    memcpy(header, hash, HASH_SIZE);
+    av_write_frame(ctx, NULL); // Output the first fragment
+    init_out("delay-moov-elst-second-frag");
+    mux_gops(1);
+    av_write_frame(ctx, NULL); // Output the second fragment
+    close_out();
+    memcpy(content, hash, HASH_SIZE);
+    finish();
+
+    av_dict_set(&opts, "movflags", "frag_custom+delay_moov+dash+frag_discont", 0);
+    av_dict_set(&opts, "fragment_index", "2", 0);
+    init(1, 0);
+    skip_gops(1);
+    mux_gops(1); // Write the second fragment
+    init_out("delay-moov-elst-init-discont");
+    av_write_frame(ctx, NULL); // Output the moov
+    close_out();
+    check(!memcmp(hash, header, HASH_SIZE), "discontinuously written header differs");
+    init_out("delay-moov-elst-second-frag-discont");
+    av_write_frame(ctx, NULL); // Output the second fragment
+    close_out();
+    check(!memcmp(hash, content, HASH_SIZE), "discontinuously written fragment differs");
+    finish();
+
+
     // Test VFR content, with sidx atoms (which declare the pts duration
     // of a fragment, forcing overriding the start pts of the next one).
     // Here, the fragment duration in pts is significantly different from
index 929f146e1e9e7907a95858c785ba50532af3908b..fec7db59527e0a5aa6f51cdc383041db8c905ba9 100644 (file)
@@ -16,5 +16,9 @@ f12baf7c4269695817337192c7069328 996 delay-moov-content
 76e1081bbab7541eadcaf4b19d37eff6 584 empty-moov-second-frag
 76e1081bbab7541eadcaf4b19d37eff6 584 empty-moov-second-frag-discont
 76e1081bbab7541eadcaf4b19d37eff6 584 delay-moov-second-frag-discont
+93d5d944d10570857b726dd1c482bc03 1207 delay-moov-elst-init
+41afdc44b0e376fae49a730afe0c53c2 704 delay-moov-elst-second-frag
+93d5d944d10570857b726dd1c482bc03 1207 delay-moov-elst-init-discont
+41afdc44b0e376fae49a730afe0c53c2 704 delay-moov-elst-second-frag-discont
 4407220c69fb6d96fd3f4daea05140c3 3647 vfr
 4407220c69fb6d96fd3f4daea05140c3 3647 vfr-noduration