Commit 74bc9458 authored by Josh Allmann's avatar Josh Allmann Committed by Anton Khirnov

flvenc: Don't over-count metadata.

Over-counting occurs if framerate is not set.
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent 49106844
......@@ -282,7 +282,7 @@ static int flv_write_header(AVFormatContext *s)
/* mixed array (hash) with size and string/type/data tuples */
avio_w8(pb, AMF_DATA_TYPE_MIXEDARRAY);
metadata_count_pos = avio_tell(pb);
metadata_count = 5 * !!video_enc +
metadata_count = 4 * !!video_enc +
5 * !!audio_enc +
1 * !!data_enc +
2; // +2 for duration and file size
......@@ -308,6 +308,7 @@ static int flv_write_header(AVFormatContext *s)
if (framerate != 0.0) {
put_amf_string(pb, "framerate");
put_amf_double(pb, framerate);
metadata_count++;
}
put_amf_string(pb, "videocodecid");
......
52ca9477330765fee525941c5a30dad1 *./tests/data/lavf/lavf.flv
822735e9d25b3eb22529f444a71840c3 *./tests/data/lavf/lavf.flv
329521 ./tests/data/lavf/lavf.flv
./tests/data/lavf/lavf.flv CRC=0x881785d1
19901e7be932c65efd46449687db4572 *tests/data/fate/vsynth1-flashsv.flv
6675942f5cd6978f16eff5305578de27 *tests/data/fate/vsynth1-flashsv.flv
14681905 tests/data/fate/vsynth1-flashsv.flv
947cb24ec45a453348ae6fe3fa278071 *tests/data/fate/vsynth1-flashsv.out.rawvideo
stddev: 2.85 PSNR: 39.03 MAXDIFF: 49 bytes: 7603200/ 7603200
615daf949171f5ce2ca9f3fd2a78b9b3 *tests/data/fate/vsynth1-flv.flv
202e8b9715f278497eb13476fc9abdac *tests/data/fate/vsynth1-flv.flv
636249 tests/data/fate/vsynth1-flv.flv
5ab46d8dd01dbb1d63df2a84858a4b05 *tests/data/fate/vsynth1-flv.out.rawvideo
stddev: 8.02 PSNR: 30.04 MAXDIFF: 105 bytes: 7603200/ 7603200
ce94a90c07434a4ebcbcab70ea69c17c *tests/data/fate/vsynth2-flashsv.flv
cd771e2b159450e63e38e26b872e548e *tests/data/fate/vsynth2-flashsv.flv
12368933 tests/data/fate/vsynth2-flashsv.flv
592b3321994e26a990deb3a0a1415de9 *tests/data/fate/vsynth2-flashsv.out.rawvideo
stddev: 0.65 PSNR: 51.84 MAXDIFF: 14 bytes: 7603200/ 7603200
9a24ba8cf7fe6c20c586a00b371eeb0b *tests/data/fate/vsynth2-flv.flv
747633a169bbfe4622c6c1a7990deafd *tests/data/fate/vsynth2-flv.flv
131340 tests/data/fate/vsynth2-flv.flv
8999c8264fb0941561f64c4a736e9d88 *tests/data/fate/vsynth2-flv.out.rawvideo
stddev: 5.33 PSNR: 33.59 MAXDIFF: 80 bytes: 7603200/ 7603200
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment