[FFmpeg-devel] [PATCH] lavf/mov: atom box parsing return eof cause play fail

Carl Eugen Hoyos ceffmpeg at gmail.com
Wed Dec 6 18:02:25 EET 2017


2017-12-06 9:25 GMT+01:00 tiejun.peng <tiejun.peng at foxmail.com>:

>      /* check MOV header */
>      do {
> -    if (mov->moov_retry)
> -        avio_seek(pb, 0, SEEK_SET);
> -    if ((err = mov_read_default(mov, pb, atom)) < 0) {
> -        av_log(s, AV_LOG_ERROR, "error reading header\n");
> -        mov_read_close(s);
> -        return err;
> -    }
> +        if (mov->moov_retry)
> +            avio_seek(pb, 0, SEEK_SET);
> +        /* EOF don't mean the file to play fail*/
> +        err = mov_read_default(mov, pb, atom);
> +        if (err < 0 && err != AVERROR_EOF) {
> +            av_log(s, AV_LOG_ERROR, "error reading header\n");
> +            mov_read_close(s);
> +            return err;
> +        }

Most of this change should be a separate (purely cosmetic) patch
to make reviewing the change (now and later) easier.

Feel free to only send your functional change (without the
re-indentation) now, the indentation can still be fixed.

Carl Eugen


More information about the ffmpeg-devel mailing list