@@ -287,7 +287,10 @@ static int peak_write_chunk(AVFormatContext *s)
avio_wl32(pb, wav->peak_block_size); /* frames per value */
avio_wl32(pb, par->channels); /* number of channels */
avio_wl32(pb, wav->peak_num_frames); /* number of peak frames */
- avio_wl32(pb, wav->peak_pos_pop); /* audio sample frame index */
+ if (wav->write_peak == PEAK_ONLY) /* audio sample frame index */
+ avio_wl32(pb, -1);
+ else
+ avio_wl32(pb, wav->peak_pos_pop);
avio_wl32(pb, 128); /* equal to size of header */
avio_write(pb, timestamp, 28); /* ASCII time stamp */
ffio_fill(pb, 0, 60);
@@ -1,2 +1,2 @@
-b609a363e6d490710ed52231a8d09d3c *./tests/data/lavf/lavf.peak_only.wav
+f1a8aeeae8069f3992c4d780436c3d23 *./tests/data/lavf/lavf.peak_only.wav
832 ./tests/data/lavf/lavf.peak_only.wav
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com> --- libavformat/wavenc.c | 5 ++++- tests/ref/lavf/wav_peak_only | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-)