Correct ASF duration.
authorHenrik Gulbrandsen <henrik@gulbra.net>
Mon, 21 Apr 2008 08:19:16 +0000 (08:19 +0000)
committerBenoit Fouet <benoit.fouet@free.fr>
Mon, 21 Apr 2008 08:19:16 +0000 (08:19 +0000)
Patch by Henrik Gulbrandsen: henrik gulbra net

Originally committed as revision 12916 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/asf-enc.c
tests/ffmpeg.regression.ref
tests/libav.regression.ref
tests/rotozoom.regression.ref

index a12cda1..6bd89f4 100644 (file)
@@ -733,11 +733,10 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt)
     if(codec->codec_type == CODEC_TYPE_AUDIO)
         flags &= ~PKT_FLAG_KEY;
 
-    //XXX /FIXME use duration from AVPacket (quick hack by)
     pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts;
     assert(pts != AV_NOPTS_VALUE);
     duration = pts * 10000;
-    asf->duration= FFMAX(asf->duration, duration);
+    asf->duration= FFMAX(asf->duration, duration + pkt->duration * 10000);
 
     packet_st = asf->nb_packets;
     put_frame(s, stream, s->streams[pkt->stream_index], pkt->dts, pkt->data, pkt->size, flags);
index 790d445..8e413fe 100644 (file)
@@ -197,11 +197,11 @@ c3382f03ce2efb5d475240d288a33898 *./tests/data/a-flac.flac
 353368 ./tests/data/a-flac.flac
 c4228df189aad9567a037727d0e763e4 *./tests/data/flac.vsynth.out.wav
 stddev: 33.31 PSNR:65.87 bytes:1040384
-a1e56bb034c2773438ba1c830c4cea07 *./tests/data/a-wmav1.asf
+4435d87463cd6c5407bd88cca241ca56 *./tests/data/a-wmav1.asf
 106004 ./tests/data/a-wmav1.asf
 stddev:12251.50 PSNR:14.56 bytes:1056768
 stddev:2106.00 PSNR:29.85 bytes:1048576
-5e25c447c80fa937f74ed8752b0e26fb *./tests/data/a-wmav2.asf
+24ae726aef89e5d17e315c64182f4c61 *./tests/data/a-wmav2.asf
 106044 ./tests/data/a-wmav2.asf
 stddev:12255.92 PSNR:14.55 bytes:1056768
 stddev:2099.31 PSNR:29.88 bytes:1048576
index 20fad3f..c751a73 100644 (file)
@@ -1,7 +1,7 @@
 8a0536ccfe36f4fff408b3327d33e1dd *./tests/data/b-libav.avi
 340344 ./tests/data/b-libav.avi
 ./tests/data/b-libav.avi CRC=0x400c29e9
-7b859661e93df32e51942a4e0531d58e *./tests/data/b-libav.asf
+bd9e0012aa39e956605387dd499365fb *./tests/data/b-libav.asf
 339775 ./tests/data/b-libav.asf
 ./tests/data/b-libav.asf CRC=0x74113749
 c351132527ccb1e8cab06cc0822fde23 *./tests/data/b-libav.rm
index bb0895b..342a9e3 100644 (file)
@@ -197,11 +197,11 @@ c3382f03ce2efb5d475240d288a33898 *./tests/data/a-flac.flac
 353368 ./tests/data/a-flac.flac
 c4228df189aad9567a037727d0e763e4 *./tests/data/flac.rotozoom.out.wav
 stddev: 33.31 PSNR:65.87 bytes:1040384
-a1e56bb034c2773438ba1c830c4cea07 *./tests/data/a-wmav1.asf
+4435d87463cd6c5407bd88cca241ca56  *./tests/data/a-wmav1.asf
 106004 ./tests/data/a-wmav1.asf
 stddev:12251.50 PSNR:14.56 bytes:1056768
 stddev:2106.00 PSNR:29.85 bytes:1048576
-5e25c447c80fa937f74ed8752b0e26fb *./tests/data/a-wmav2.asf
+24ae726aef89e5d17e315c64182f4c61 *./tests/data/a-wmav2.asf
 106044 ./tests/data/a-wmav2.asf
 stddev:12255.92 PSNR:14.55 bytes:1056768
 stddev:2099.31 PSNR:29.88 bytes:1048576