[FFmpeg-devel] [RFC][PATCH] avformat/flvdec: avoid reseting eof_reached to 0 silently

Zhang Rui bbcallen at gmail.com
Sun Apr 12 06:00:18 CEST 2015

2015-04-10 22:04 GMT+08:00 wm4 <nfxjfg at googlemail.com>:
> On Fri, 10 Apr 2015 21:17:42 +0800
> Zhang Rui <bbcallen at gmail.com> wrote:
>> This kind of error handling need some more work in aviobuf.c,
>> and more advises from ffmpeg developers.
>> And i prefer this way than the patch I posted.
> stdio.h does it this way: FILE has an error flag that is set when
> something goes wrong.

AVIOContext has an error field, too. But I don't think it's enough
for EAGAIN situation without some convention.
At least, ffplay doesn't show that.

>> > Also, why doesn't avio_skip() return an error if the skip count is not
>> > 0 and the stream has reached EOF?
>> The eof handling is quite confusing in ffplay for me. AVERROR_EOF is
>> clear enough.
> Well, I have no idea what avio_skip() even returns... it just calls
> avio_seek(), which is a goddamn fucked up mess thanks to years of
> people adding hacks.

Is there any correct direction to fix it?

> ffplay probably does it wrong. Wouldn't be surprising. It checks
> avio_feof() after a av_read_frame() call, which doesn't look correct.
> File EOF has absolutely nothing to do with whether a demuxer still has
> data.
> On a side note, I'm not sure whether av_read_frame() returning
> AVERROR_EOF is an error at all, or just signals that the end of the
> file was reached. The doxygen on this function isn't helpful either.

Is there any ideas, or any helpful keywords or threads in mail list archive?

More information about the ffmpeg-devel mailing list