mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-15 02:58:01 +00:00
avformat/aviobuf: return stored AVIO context error on avio_close
Otherwise IO errors at avio_flush() before closing may be lost. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
722d28db12
commit
8a40cfa4da
@ -1231,6 +1231,7 @@ int avio_close(AVIOContext *s)
|
|||||||
{
|
{
|
||||||
FFIOContext *const ctx = ffiocontext(s);
|
FFIOContext *const ctx = ffiocontext(s);
|
||||||
URLContext *h;
|
URLContext *h;
|
||||||
|
int ret, error;
|
||||||
|
|
||||||
if (!s)
|
if (!s)
|
||||||
return 0;
|
return 0;
|
||||||
@ -1249,9 +1250,14 @@ int avio_close(AVIOContext *s)
|
|||||||
ctx->bytes_read, ctx->seek_count);
|
ctx->bytes_read, ctx->seek_count);
|
||||||
av_opt_free(s);
|
av_opt_free(s);
|
||||||
|
|
||||||
|
error = s->error;
|
||||||
avio_context_free(&s);
|
avio_context_free(&s);
|
||||||
|
|
||||||
return ffurl_close(h);
|
ret = ffurl_close(h);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
int avio_closep(AVIOContext **s)
|
int avio_closep(AVIOContext **s)
|
||||||
|
Loading…
Reference in New Issue
Block a user