[FFmpeg-devel] [PATCH] wavdec: RIFX file format support

Carl Eugen Hoyos cehoyos at ag.or.at
Wed Dec 17 11:36:27 CET 2014


Thomas Volkert <silvo <at> gmx.net> writes:

> -    id                 = avio_rl16(pb);
>      codec->codec_type  = AVMEDIA_TYPE_AUDIO;
> -    codec->channels    = avio_rl16(pb);
> -    codec->sample_rate = avio_rl32(pb);
> -    codec->bit_rate    = avio_rl32(pb) * 8;
> -    codec->block_align = avio_rl16(pb);
> +    if (!big_endian) {
> +        id                 = avio_rl16(pb);
> +        codec->channels    = avio_rl16(pb);

Please answer Reimar if you don't want to follow 
his suggestion: If you don't answer, it usually 
means "I will comply" (here).

> -    avio_rl32(pb); /* file size */
> -    tag = avio_rl32(pb);

I known this is not very important but if you 
don't remove these two lines, the patch gets 
smaller by around four lines and this makes 
reviews easier...

> -    if (tag != MKTAG('W', 'A', 'V', 'E'))

> +    if (avio_rl32(pb) != MKTAG('W', 'A', 'V', 'E')) {

> +        av_log(s, AV_LOG_ERROR, "invalid format in RIFF header\n");

This may be a good idea but I think it 
should not be part of this patch.

Thank you, Carl Eugen



More information about the ffmpeg-devel mailing list