]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Correct ASF duration.
authorbenoit <benoit@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 21 Apr 2008 08:19:16 +0000 (08:19 +0000)
committerbenoit <benoit@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 21 Apr 2008 08:19:16 +0000 (08:19 +0000)
Patch by Henrik Gulbrandsen: henrik gulbra net

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@12916 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

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

index a12cda1e7c0e30107fff018446bc311ee0ab50c4..6bd89f4e1ed44f49ca9cf3a9fe9245a0b3910a97 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 790d44570f7de95ffc8c58560a09e33e64b43eb1..8e413fe724eec801db469b92c1491e82c913e1ef 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 20fad3f9d3f864994d4c435d87e5a16aeaeb2c79..c751a73f5bd401f2382b929226f0393ee9816e75 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 bb0895bb26b8dfa28f97de8e5f3a7adca861f9f5..342a9e33e348608fea6e309e8dc322795c28bdbc 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