[FFmpeg-devel] [PATCH] Waveform Archiver decoder and demuxer
    Tomas Härdin 
    git at haerdin.se
       
    Wed Feb  1 11:36:30 EET 2023
    
    
  
> +    if (avctx->extradata_size < 44)
> +        return AVERROR_INVALIDDATA;
> +    if (AV_RL32(avctx->extradata + 16) != MKTAG('R','I','F','F'))
> +        return AVERROR_INVALIDDATA;
> +    if (AV_RL32(avctx->extradata + 24) != MKTAG('W','A','V','E'))
> +        return AVERROR_INVALIDDATA;
> +    if (AV_RL32(avctx->extradata + 28) != MKTAG('f','m','t',' '))
> +        return AVERROR_INVALIDDATA;
> +    if (AV_RL16(avctx->extradata + 38) != 1 &&
> +        AV_RL16(avctx->extradata + 38) != 2)
> +        return AVERROR_INVALIDDATA;
What in tarnation
> +    av_channel_layout_default(&avctx->ch_layout, AV_RL16(avctx-
> >extradata + 38));
> +    avctx->sample_rate = AV_RL32(avctx->extradata + 40);
> 
This belongs in the demuxer. In fact it appears the decoder duplicates
code from the demuxer. Why? Some samples would help.
/Tomas
    
    
More information about the ffmpeg-devel
mailing list