diff mbox

[FFmpeg-devel,2/2] avformat/wavenc: skip writing peak-of-peaks position when writing peaks only

Message ID 1506697696-21235-2-git-send-email-t.rapp@noa-archive.com
State Superseded
Headers show

Commit Message

Tobias Rapp Sept. 29, 2017, 3:08 p.m. UTC
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(-)

Comments

Michael Niedermayer Sept. 30, 2017, 12:48 a.m. UTC | #1
On Fri, Sep 29, 2017 at 05:08:16PM +0200, Tobias Rapp wrote:
> 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(-)

The commit message doest say why this chnage is done

[...]
diff mbox

Patch

diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
index adb20cb..7a4acf9 100644
--- a/libavformat/wavenc.c
+++ b/libavformat/wavenc.c
@@ -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);
diff --git a/tests/ref/lavf/wav_peak_only b/tests/ref/lavf/wav_peak_only
index dccd0e7..b203d03 100644
--- a/tests/ref/lavf/wav_peak_only
+++ b/tests/ref/lavf/wav_peak_only
@@ -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