summaryrefslogtreecommitdiff
path: root/libavformat/wavenc.c
diff options
context:
space:
mode:
authorTobias Rapp <t.rapp@noa-archive.com>2017-09-29 16:32:20 +0200
committerTobias Rapp <t.rapp@noa-archive.com>2017-10-26 08:29:41 +0200
commita07ac9302335c1f12dcfb7d4ef57689f25c8e2c4 (patch)
tree39383827ac5ea455913ce6fcbe18cfd99059d371 /libavformat/wavenc.c
parentae100046ca32b0b83031a60d0c3cdfc5ceb9f874 (diff)
downloadffmpeg-a07ac9302335c1f12dcfb7d4ef57689f25c8e2c4.tar.gz
avformat/wavenc: skip writing incorrect peak-of-peaks position value
According to EBU tech 3285 supplement 3 the dwPosPeakOfPeaks field should contain the absolute position to the maximum audio sample value, but the current implementation writes the relative peak frame index instead. Fix the issue by writing the "unknown" value (-1) for now until the feature is implemented correctly. Previous version reviewed-by: Peter Bubestinger <p.bubestinger@av-rd.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
Diffstat (limited to 'libavformat/wavenc.c')
-rw-r--r--libavformat/wavenc.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
index adb20cb215..159119d693 100644
--- a/libavformat/wavenc.c
+++ b/libavformat/wavenc.c
@@ -74,8 +74,6 @@ typedef struct WAVMuxContext {
uint32_t peak_num_frames;
uint32_t peak_outbuf_size;
uint32_t peak_outbuf_bytes;
- uint32_t peak_pos_pop;
- uint16_t peak_pop;
uint8_t *peak_output;
int last_duration;
int write_bext;
@@ -195,7 +193,6 @@ static void peak_write_frame(AVFormatContext *s)
{
WAVMuxContext *wav = s->priv_data;
AVCodecParameters *par = s->streams[0]->codecpar;
- int peak_of_peaks;
int c;
if (!wav->peak_output)
@@ -213,12 +210,6 @@ static void peak_write_frame(AVFormatContext *s)
wav->peak_maxpos[c] =
FFMAX(wav->peak_maxpos[c], wav->peak_maxneg[c]);
- peak_of_peaks = FFMAX3(wav->peak_maxpos[c], wav->peak_maxneg[c],
- wav->peak_pop);
- if (peak_of_peaks > wav->peak_pop)
- wav->peak_pos_pop = wav->peak_num_frames;
- wav->peak_pop = peak_of_peaks;
-
if (wav->peak_outbuf_size - wav->peak_outbuf_bytes <
wav->peak_format * wav->peak_ppv) {
wav->peak_outbuf_size += PEAK_BUFFER_SIZE;
@@ -287,7 +278,7 @@ 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 */
+ avio_wl32(pb, -1); /* audio sample frame position (not implemented) */
avio_wl32(pb, 128); /* equal to size of header */
avio_write(pb, timestamp, 28); /* ASCII time stamp */
ffio_fill(pb, 0, 60);