[Ffmpeg-cvslog] r7903 - in trunk: libavformat/asf-enc.c tests/ffmpeg.regression.ref tests/libav.regression.ref tests/rotozoom.regression.ref
michael
subversion
Fri Feb 9 21:49:13 CET 2007
Author: michael
Date: Fri Feb 9 21:49:12 2007
New Revision: 7903
Modified:
trunk/libavformat/asf-enc.c
trunk/tests/ffmpeg.regression.ref
trunk/tests/libav.regression.ref
trunk/tests/rotozoom.regression.ref
Log:
fix broken memset(padding, 0) code
add a few asserts
Modified: trunk/libavformat/asf-enc.c
==============================================================================
--- trunk/libavformat/asf-enc.c (original)
+++ trunk/libavformat/asf-enc.c Fri Feb 9 21:49:12 2007
@@ -537,6 +537,11 @@
int iLengthTypeFlags = ASF_PPI_LENGTH_TYPE_FLAGS;
+ padsize -= PACKET_HEADER_MIN_SIZE;
+ if(asf->multi_payloads_present)
+ padsize--;
+ assert(padsize>=0);
+
put_byte(pb, ASF_PACKET_ERROR_CORRECTION_FLAGS);
for (i = 0; i < ASF_PACKET_ERROR_CORRECTION_DATA_SIZE; i++){
put_byte(pb, 0x0);
@@ -587,7 +592,8 @@
asf->packet_size_left
);
- packet_filled_size = PACKET_SIZE - packet_hdr_size - asf->packet_size_left;
+ packet_filled_size = PACKET_SIZE - asf->packet_size_left;
+ assert(packet_hdr_size <= asf->packet_size_left);
memset(asf->packet_buf + packet_filled_size, 0, asf->packet_size_left);
put_buffer(&s->pb, asf->packet_buf, asf->packet_size - packet_hdr_size);
@@ -656,20 +662,18 @@
if (asf->packet_timestamp_start == -1) {
asf->multi_payloads_present = (payload_len < MULTI_PAYLOAD_CONSTANT);
+ asf->packet_size_left = PACKET_SIZE;
if (asf->multi_payloads_present){
- asf->packet_size_left = PACKET_SIZE; //For debug
- asf->packet_size_left = PACKET_SIZE - PACKET_HEADER_MIN_SIZE - 1;
frag_len1 = MULTI_PAYLOAD_CONSTANT - 1;
}
else {
- asf->packet_size_left = PACKET_SIZE - PACKET_HEADER_MIN_SIZE;
frag_len1 = SINGLE_PAYLOAD_DATA_LENGTH;
}
asf->packet_timestamp_start = timestamp;
}
else {
// multi payloads
- frag_len1 = asf->packet_size_left - PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS;
+ frag_len1 = asf->packet_size_left - PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS - PACKET_HEADER_MIN_SIZE - 1;
asf->packet_timestamp_start = timestamp;
}
@@ -697,7 +701,7 @@
if (!asf->multi_payloads_present)
flush_packet(s);
- else if (asf->packet_size_left <= (PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS + 1))
+ else if (asf->packet_size_left <= (PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS + PACKET_HEADER_MIN_SIZE + 1))
flush_packet(s);
}
stream->seq++;
Modified: trunk/tests/ffmpeg.regression.ref
==============================================================================
--- trunk/tests/ffmpeg.regression.ref (original)
+++ trunk/tests/ffmpeg.regression.ref Fri Feb 9 21:49:12 2007
@@ -188,17 +188,17 @@
353368 ./data/a-flac.flac
c4228df189aad9567a037727d0e763e4 *./data/out.wav
stddev: 33.31 PSNR:65.87 bytes:1040384
-9fe59eb60481009f6f7d13d1b031975d *./data/a-wmav1.asf
+768305cec342e01b7a9d38e971ef0174 *./data/a-wmav1.asf
99596 ./data/a-wmav1.asf
2ab193df22bb473e61015e56ac11faf3 *./data/out.wav
stddev:12251.50 PSNR:14.56 bytes:1056768
stddev:2106.00 PSNR:29.85 bytes:1048576
-ff09659af56c931350db4dec737eea7f *./data/a-wmav2.asf
+c706c7cf9db10df7a7353a40feddcfdd *./data/a-wmav2.asf
99602 ./data/a-wmav2.asf
8d05d345bc14153f3d0da95fdf34e084 *./data/out.wav
stddev:12255.92 PSNR:14.55 bytes:1056768
stddev:2099.31 PSNR:29.88 bytes:1048576
-e56c2c60b025594eac3ba670ae3cc50d *./data/a-vorbis.asf
+ef725cb9c13b9437a41428eabadeba52 *./data/a-vorbis.asf
35686 ./data/a-vorbis.asf
-295d828df6167db030d0812ce1a8fd93 *./data/out.wav
+e46368ef818f2ec3abcc3f8390d14df5 *./data/out.wav
stddev:3882.46 PSNR:24.54 bytes:1056768
Modified: trunk/tests/libav.regression.ref
==============================================================================
--- trunk/tests/libav.regression.ref (original)
+++ trunk/tests/libav.regression.ref Fri Feb 9 21:49:12 2007
@@ -2,7 +2,7 @@
8a0536ccfe36f4fff408b3327d33e1dd *./data/b-libav.avi
340344 ./data/b-libav.avi
./data/b-libav.avi CRC=0x400c29e9
-af76964183b72ab3e18f1581e55950db *./data/b-libav.asf
+149792fc0d4e5ccb395c47716e2975d9 *./data/b-libav.asf
339767 ./data/b-libav.asf
./data/b-libav.asf CRC=0x74113749
1ad618e9fd318eb3483270cf9b9b3f43 *./data/b-libav.rm
Modified: trunk/tests/rotozoom.regression.ref
==============================================================================
--- trunk/tests/rotozoom.regression.ref (original)
+++ trunk/tests/rotozoom.regression.ref Fri Feb 9 21:49:12 2007
@@ -188,17 +188,17 @@
353368 ./data/a-flac.flac
c4228df189aad9567a037727d0e763e4 *./data/out.wav
stddev: 33.31 PSNR:65.87 bytes:1040384
-9fe59eb60481009f6f7d13d1b031975d *./data/a-wmav1.asf
+768305cec342e01b7a9d38e971ef0174 *./data/a-wmav1.asf
99596 ./data/a-wmav1.asf
2ab193df22bb473e61015e56ac11faf3 *./data/out.wav
stddev:12251.50 PSNR:14.56 bytes:1056768
stddev:2106.00 PSNR:29.85 bytes:1048576
-ff09659af56c931350db4dec737eea7f *./data/a-wmav2.asf
+c706c7cf9db10df7a7353a40feddcfdd *./data/a-wmav2.asf
99602 ./data/a-wmav2.asf
8d05d345bc14153f3d0da95fdf34e084 *./data/out.wav
stddev:12255.92 PSNR:14.55 bytes:1056768
stddev:2099.31 PSNR:29.88 bytes:1048576
-e56c2c60b025594eac3ba670ae3cc50d *./data/a-vorbis.asf
+ef725cb9c13b9437a41428eabadeba52 *./data/a-vorbis.asf
35686 ./data/a-vorbis.asf
-295d828df6167db030d0812ce1a8fd93 *./data/out.wav
+e46368ef818f2ec3abcc3f8390d14df5 *./data/out.wav
stddev:3882.46 PSNR:24.54 bytes:1056768
More information about the ffmpeg-cvslog
mailing list