mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-14 03:04:53 +00:00
Simplify av_close_input_file similarly to av_open_input_file previously
Originally committed as revision 11254 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
17acc63a32
commit
ca75a92325
@ -2041,7 +2041,7 @@ int av_read_pause(AVFormatContext *s)
|
|||||||
|
|
||||||
void av_close_input_file(AVFormatContext *s)
|
void av_close_input_file(AVFormatContext *s)
|
||||||
{
|
{
|
||||||
int i, must_open_file;
|
int i;
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
|
|
||||||
/* free previous packet */
|
/* free previous packet */
|
||||||
@ -2068,13 +2068,8 @@ void av_close_input_file(AVFormatContext *s)
|
|||||||
av_freep(&s->programs[i]);
|
av_freep(&s->programs[i]);
|
||||||
}
|
}
|
||||||
flush_packet_queue(s);
|
flush_packet_queue(s);
|
||||||
must_open_file = 1;
|
if (!(s->iformat->flags & AVFMT_NOFILE))
|
||||||
if (s->iformat->flags & AVFMT_NOFILE) {
|
|
||||||
must_open_file = 0;
|
|
||||||
}
|
|
||||||
if (must_open_file) {
|
|
||||||
url_fclose(s->pb);
|
url_fclose(s->pb);
|
||||||
}
|
|
||||||
av_freep(&s->priv_data);
|
av_freep(&s->priv_data);
|
||||||
av_free(s);
|
av_free(s);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user