History

avformat/demux: use io_close2 when closing avfromat

It's not valid to call avio_close() on context that has not been open with avio_open(). This fixes use of custom IO. (io_open / io_close2 callbacks) Note that by default io_close2 is set to io_close2_default() which calls avio_close(), so default case will work the same as before.

Kacper Michajłow committed 1 year ago

Commit 1a7e8021 parent 50305641 file · +1 −2Browse files

Unified · Split

libavformat/demux.c+1−2
@@ -383,11 +383,10 @@ void avformat_close_input(AVFormatContext **ps) · 382 unmodified lines
383 if (ffifmt(s->iformat)->read_close)383 if (ffifmt(s->iformat)->read_close)
384 ffifmt(s->iformat)->read_close(s);384 ffifmt(s->iformat)->read_close(s);
385 385
386 ff_format_io_close(s, &pb);
386 avformat_free_context(s);387 avformat_free_context(s);
387 388
388 *ps = NULL;389 *ps = NULL;
389
390 avio_close(pb);
391}390}
392 391
393static void force_codec_ids(AVFormatContext *s, AVStream *st)392static void force_codec_ids(AVFormatContext *s, AVStream *st)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t