[FFmpeg-devel] [PATCH] movenc-test: Pad the packet data start with 0s

Derek Buitenhuis derek.buitenhuis at gmail.com
Tue Nov 17 17:00:30 CET 2015


This way, it never starts with 0xFFF0, and never trips the
ADTS "Detection" code in movenc.c.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
---
 libavformat/movenc-test.c |  4 ++--
 tests/ref/fate/movenc     | 40 ++++++++++++++++++++--------------------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/libavformat/movenc-test.c b/libavformat/movenc-test.c
index 8132bab..ceaebca 100644
--- a/libavformat/movenc-test.c
+++ b/libavformat/movenc-test.c
@@ -215,7 +215,7 @@ static void mux_frames(int n)
     int end_frames = frames + n;
     while (1) {
         AVPacket pkt;
-        uint8_t pktdata[4];
+        uint8_t pktdata[8] = { 0 };
         av_init_packet(&pkt);
 
         if (av_compare_ts(audio_dts, audio_st->time_base, video_dts, video_st->time_base) < 0) {
@@ -257,7 +257,7 @@ static void mux_frames(int n)
 
         if (clear_duration)
             pkt.duration = 0;
-        AV_WB32(pktdata, pkt.pts);
+        AV_WB32(pktdata + 4, pkt.pts);
         pkt.data = pktdata;
         pkt.size = 4;
         if (skip_write)
diff --git a/tests/ref/fate/movenc b/tests/ref/fate/movenc
index dffb30c..cfd44b6 100644
--- a/tests/ref/fate/movenc
+++ b/tests/ref/fate/movenc
@@ -1,24 +1,24 @@
-167647a7019bb1f134329b22bd4ddcdf 2681 non-empty-moov
-8a7595021c11a848ac20ec4f77c9d0bf 3113 non-empty-moov-elst
-f9d6b8fce9404a8d2a947badcf65fba6 3049 non-empty-moov-no-elst
-d43b8a181c074d94f152e6f03f83abb2 9115 ismv
-204d141d70e4801333ab516bb9e1d3fc 2303 empty-moov
-5af446fd5e0a7978e8dff9511938ddab 2703 empty-moov-no-elst
-ad43cfb415822a0d70db0f11a87ced66 2535 empty-moov-no-elst-no-adjust
-204d141d70e4801333ab516bb9e1d3fc 2303 delay-moov
-0cf964a5e0908cfb3a023d5c48776ac6 2607 delay-moov-elst
-9a6a892af043f1d77b2f5ee6deaadcd7 1858 delay-moov-empty-track
-7453fb089ad8799669259cbf559bdb37 1761 delay-moov-empty-track-flush
+8640655fe9f334567914a271b0562814 2681 non-empty-moov
+b26878413cc219466b74873d6807fead 3133 non-empty-moov-elst
+3255a5793c7cee29a448b48322be0dfc 3049 non-empty-moov-no-elst
+ccb2f7ee0238211717c7b17302a2d6aa 9115 ismv
+545dc1cdbfdb723e682d1ea0073cc796 2303 empty-moov
+3a8ded16d8a0e090443cb9ea9f151b69 2703 empty-moov-no-elst
+225eab20bbde34d150e7599def6b79b3 2535 empty-moov-no-elst-no-adjust
+545dc1cdbfdb723e682d1ea0073cc796 2303 delay-moov
+68c3a59496b6af02aaa9015196abc11c 2615 delay-moov-elst
+ad6dbc451926b5ee533110dae844cbd6 1858 delay-moov-empty-track
+77dc5c2e63514a3c86a59de786c57f11 1761 delay-moov-empty-track-flush
 39d798aa11a265c7906f9e11d4f303c0 1159 empty-moov-header
-473d94ed152c332015f7e1d327fa855d 996 empty-moov-content
+baab3c7d611539f24299351e02bc5be2 996 empty-moov-content
 39d798aa11a265c7906f9e11d4f303c0 1159 delay-moov-header
-473d94ed152c332015f7e1d327fa855d 996 delay-moov-content
-64e38d416e9344c8046e37426cdf2807 584 empty-moov-second-frag
-64e38d416e9344c8046e37426cdf2807 584 empty-moov-second-frag-discont
-64e38d416e9344c8046e37426cdf2807 584 delay-moov-second-frag-discont
+baab3c7d611539f24299351e02bc5be2 996 delay-moov-content
+f0b3faa82a3691b180906c9ed215da57 584 empty-moov-second-frag
+f0b3faa82a3691b180906c9ed215da57 584 empty-moov-second-frag-discont
+f0b3faa82a3691b180906c9ed215da57 584 delay-moov-second-frag-discont
 6256445b9595de78be493e0faf2bc5d7 1219 delay-moov-elst-init
-5bcd7237855218554de38044dbd31cda 704 delay-moov-elst-second-frag
+052e474c722478f5b8fb4b235309356e 704 delay-moov-elst-second-frag
 6256445b9595de78be493e0faf2bc5d7 1219 delay-moov-elst-init-discont
-5bcd7237855218554de38044dbd31cda 704 delay-moov-elst-second-frag-discont
-da0d89d03fa601b40f6a653c8314e333 3615 vfr
-da0d89d03fa601b40f6a653c8314e333 3615 vfr-noduration
+052e474c722478f5b8fb4b235309356e 704 delay-moov-elst-second-frag-discont
+838551b5743ef887d0d1e75a60549818 3623 vfr
+838551b5743ef887d0d1e75a60549818 3623 vfr-noduration
-- 
2.6.2



More information about the ffmpeg-devel mailing list