avio: flush the internal buffer in avio_close()

This is consistent with stdio, and thus what people would naturally
expect.
This commit is contained in:
Stefano Sabatini
2012-08-16 01:25:05 +02:00
committed by Anton Khirnov
parent 0443879089
commit 5d1203f063
4 changed files with 5 additions and 3 deletions

View File

@@ -761,6 +761,7 @@ int avio_close(AVIOContext *s)
if (!s)
return 0;
avio_flush(s);
h = s->opaque;
av_freep(&s->buffer);
av_free(s);