Ticket #1579: patchadpcmwav.diff

File patchadpcmwav.diff, 616 bytes (added by cehoyos, 3 years ago)
  • libavformat/riffenc.c

    diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c
    index bcfe018..57bfb7f 100644
    a b int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc) 
    165165        bytestream_put_le16(&riff_extradata, 0xacde); 
    166166    } else if (enc->codec_id == AV_CODEC_ID_GSM_MS || 
    167167               enc->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV) { 
     168        if (!frame_size && enc->extradata_size == 2) 
     169            frame_size = AV_RL16(enc->extradata); 
    168170        hdrsize += 2; 
    169171        /* wSamplesPerBlock */ 
    170172        bytestream_put_le16(&riff_extradata, frame_size);