[FFmpeg-devel] [PATCH]Only run the tta crc checks if requested

James Almer jamrial at gmail.com
Fri Feb 6 17:03:33 CET 2015


On 06/02/15 6:15 AM, Carl Eugen Hoyos wrote:
> -    crc = ffio_get_checksum(s->pb) ^ UINT32_MAX;
> -    if (crc != avio_rl32(s->pb) && s->error_recognition & AV_EF_CRCCHECK) {
> -        av_log(s, AV_LOG_ERROR, "Header CRC error\n");
> -        return AVERROR_INVALIDDATA;
> +    if (s->error_recognition & AV_EF_CRCCHECK) {
> +        crc = ffio_get_checksum(s->pb) ^ UINT32_MAX;
> +        if (crc != avio_rl32(s->pb) && s->error_recognition & AV_EF_CRCCHECK) {
> +            av_log(s, AV_LOG_ERROR, "Header CRC error\n");
> +            return AVERROR_INVALIDDATA;
> +        }

This is skipping avio_rl32() and not updating the pb pointer when crc is not checked, which 
is the same trap i feel into the first time.

Nonetheless, i didn't go with something like the above to keep it simple and because this is 
done when demuxing the header, which is extremely small and read only once anyway.
This is certainly no bottleneck.


More information about the ffmpeg-devel mailing list