mbox series

[FFmpeg-devel,0/5] Fix adpcm_swf support in WAV.

Message ID 20201016062049.2746-1-zane@zanevaniperen.com
Headers show
Series Fix adpcm_swf support in WAV. | expand

Message

Zane van Iperen Oct. 16, 2020, 6:22 a.m. UTC
adpcm_swf support in WAV is completely broken. block_align isn't set correctly, so
the demuxer gives incorrect packets to the decoder. The encoder doesn't provide a
value for block_align, so it's set to 1.

All of this has no bearing on (de)muxing to FLV.

See https://trac.ffmpeg.org/ticket/5829.

Zane van Iperen (5):
  avformat/wav: prevent muxing adpcm_swf with a variable block size
  avcodec/adpcm_swf: support decoding multiple fixed-sized blocks at
    once
  avcodec/adpcm_swf: set block_align when encoding
  avcodec/adpcmenc: cosmetics
  fate: add test for adpcm_swf in wav

 libavcodec/adpcm.c             | 15 +++++++++++++--
 libavcodec/adpcmenc.c          |  9 ++++-----
 libavformat/wavenc.c           |  7 +++++++
 tests/fate/acodec.mak          |  7 +++++--
 tests/ref/acodec/adpcm-swf-flv |  4 ++++
 tests/ref/acodec/adpcm-swf-wav |  4 ++++
 6 files changed, 37 insertions(+), 9 deletions(-)
 create mode 100644 tests/ref/acodec/adpcm-swf-flv
 create mode 100644 tests/ref/acodec/adpcm-swf-wav

Comments

Zane van Iperen Oct. 18, 2020, 2:13 a.m. UTC | #1
On 16/10/20 4:22 pm, Zane van Iperen wrote:
> 
> adpcm_swf support in WAV is completely broken. block_align isn't set correctly, so
> the demuxer gives incorrect packets to the decoder. The encoder doesn't provide a
> value for block_align, so it's set to 1.
> 
> All of this has no bearing on (de)muxing to FLV.
> 
> See https://trac.ffmpeg.org/ticket/5829.
> 

Ping. I'd really like another set of eyes on this, especially because 
I'm tweaking
the behaviour of the WAV muxer.
Zane
Zane van Iperen Oct. 19, 2020, 10:36 a.m. UTC | #2
On 16/10/20 4:22 pm, Zane van Iperen wrote:
> 
> adpcm_swf support in WAV is completely broken. block_align isn't set correctly, so
> the demuxer gives incorrect packets to the decoder. The encoder doesn't provide a
> value for block_align, so it's set to 1.
> 
> All of this has no bearing on (de)muxing to FLV.
> 
> See https://trac.ffmpeg.org/ticket/5829.
> 

Ping 2. I will apply this tomorrow (+FATE fix).

Zane
Anton Khirnov Oct. 19, 2020, 2:17 p.m. UTC | #3
Quoting Zane van Iperen (2020-10-18 04:13:57)
> 
> 
> On 16/10/20 4:22 pm, Zane van Iperen wrote:
> > 
> > adpcm_swf support in WAV is completely broken. block_align isn't set correctly, so
> > the demuxer gives incorrect packets to the decoder. The encoder doesn't provide a
> > value for block_align, so it's set to 1.
> > 
> > All of this has no bearing on (de)muxing to FLV.
> > 
> > See https://trac.ffmpeg.org/ticket/5829.
> > 
> 
> Ping. I'd really like another set of eyes on this, especially because 
> I'm tweaking
> the behaviour of the WAV muxer.

I am no expert on the intricacies of wav, but it looks simple enough.
I'm just wondering if ff_put_wav_header() is not a better place for the
check.