Turn off usage of base_data_offset in tfhd for PIFF files
authorJeremy Hinegardner <jeremy@copiousfreetime.org>
Sun, 24 Mar 2013 05:15:31 +0000 (23:15 -0600)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 17 May 2013 08:04:45 +0000 (10:04 +0200)
According to the PIFF specification[1] the base_data_offset field MUST be
omitteed. See section 5.2.17. Since the ISMV files created by ffmpeg state
that they are 'piff' compatible via 'ftyp' box, this needs to be corrected.

[1] http://www.iis.net/learn/media/smooth-streaming/protected-interoperable-file-format

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/movenc.c
tests/ref/lavf/ismv

index 8b3ad7f..594f22b 100644 (file)
@@ -2505,9 +2505,11 @@ static int mov_write_tfhd_tag(AVIOContext *pb, MOVTrack *track,
 
     /* Don't set a default sample size, the silverlight player refuses
      * to play files with that set. Don't set a default sample duration,
-     * WMP freaks out if it is set. */
+     * WMP freaks out if it is set. Don't set a base data offset, PIFF
+     * file format says it MUST NOT be set. */
     if (track->mode == MODE_ISM)
-        flags &= ~(MOV_TFHD_DEFAULT_SIZE | MOV_TFHD_DEFAULT_DURATION);
+        flags &= ~(MOV_TFHD_DEFAULT_SIZE | MOV_TFHD_DEFAULT_DURATION |
+                   MOV_TFHD_BASE_DATA_OFFSET);
 
     avio_wb32(pb, 0); /* size placeholder */
     ffio_wfourcc(pb, "tfhd");
index 6f9f57b..05bb575 100644 (file)
@@ -1,9 +1,9 @@
-a24a0426b5f8dc896daaf18502e38790 *./tests/data/lavf/lavf.ismv
-312263 ./tests/data/lavf/lavf.ismv
+3a2563358cc91017fc96f9e690f26b85 *./tests/data/lavf/lavf.ismv
+312255 ./tests/data/lavf/lavf.ismv
 ./tests/data/lavf/lavf.ismv CRC=0x9d9a638a
-1b98502911dd19a9792777de67922db2 *./tests/data/lavf/lavf.ismv
-321189 ./tests/data/lavf/lavf.ismv
+77dec1248e2c4d3b2b44dfe6bd27149a *./tests/data/lavf/lavf.ismv
+321181 ./tests/data/lavf/lavf.ismv
 ./tests/data/lavf/lavf.ismv CRC=0xe8130120
-a24a0426b5f8dc896daaf18502e38790 *./tests/data/lavf/lavf.ismv
-312263 ./tests/data/lavf/lavf.ismv
+3a2563358cc91017fc96f9e690f26b85 *./tests/data/lavf/lavf.ismv
+312255 ./tests/data/lavf/lavf.ismv
 ./tests/data/lavf/lavf.ismv CRC=0x9d9a638a