diff options
author | Marton Balint <cus@passwd.hu> | 2019-08-24 22:00:12 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2019-08-31 17:38:25 +0200 |
commit | ce1fcc8cede2971f6e36119e9dd41fb41b36c63a (patch) | |
tree | e16ce1d0cdb1d6df65247aa974b0bcdb39243f72 /libavcodec/mdct15.c | |
parent | 2e31774b409d77f046f166fb3ff630a9ef91def7 (diff) | |
download | ffmpeg-ce1fcc8cede2971f6e36119e9dd41fb41b36c63a.tar.gz |
avformat/utils: return pending IO error on EOF in av_read_frame()
avio_feof() returns true both in case of actual EOF and in case of IO errors.
Some demuxers (matroska) have special handling to be able to return the proper
error for this exact reason, e.g.:
if (avio_feof(pb)) {
if (pb->error) {
return pb->error;
} else {
return AVERROR_EOF;
}
}
However, most of the demuxers do not, and they simply return AVERROR_EOF if
avio_feof() is true, so there is a real chance that IO errors are mistaken for
EOF.
We might just say that the API user should always check the IO context error
attribute on EOF to make sure no IO errors happened, but not even ffmpeg.c does
this. It should be more intuitive to the API user if we simply return the IO
error as the return value of av_read_frame() instead of AVERROR_EOF.
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavcodec/mdct15.c')
0 files changed, 0 insertions, 0 deletions