summaryrefslogtreecommitdiff
path: root/libavformat/movenc-test.c
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2015-11-17 14:56:55 +0000
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2015-11-17 14:57:20 +0000
commitf6e5b17abb44203bf830dda93d4927ce9a1d2675 (patch)
treed0987379b83500c72527fbcd22ac786515802d55 /libavformat/movenc-test.c
parent6c9fb32ae47678ca1025d92f30926015d5e8a9ad (diff)
parent3eeb7edfc2a1157b7b0e0ce21ac2cd44d55d405b (diff)
Merge commit '3eeb7edfc2a1157b7b0e0ce21ac2cd44d55d405b'
* commit '3eeb7edfc2a1157b7b0e0ce21ac2cd44d55d405b': movenc: Add a unit test for frag_discont with edit lists Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat/movenc-test.c')
-rw-r--r--libavformat/movenc-test.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/libavformat/movenc-test.c b/libavformat/movenc-test.c
index d72aaec364..8132babbbe 100644
--- a/libavformat/movenc-test.c
+++ b/libavformat/movenc-test.c
@@ -542,6 +542,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