Commit 0eb83827 authored by reimar's avatar reimar

Add a av_close_input_stream function


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11269 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent ffd13937
......@@ -661,6 +661,12 @@ int av_read_play(AVFormatContext *s);
*/
int av_read_pause(AVFormatContext *s);
/**
* Free a AVFormatContext allocated by av_open_input_stream.
* @param s context to free
*/
void av_close_input_stream(AVFormatContext *s);
/**
* Close a media file (but not its codecs).
*
......
......@@ -2056,7 +2056,7 @@ int av_read_pause(AVFormatContext *s)
return AVERROR(ENOSYS);
}
void av_close_input_file(AVFormatContext *s)
void av_close_input_stream(AVFormatContext *s)
{
int i;
AVStream *st;
......@@ -2085,12 +2085,18 @@ void av_close_input_file(AVFormatContext *s)
av_freep(&s->programs[i]);
}
flush_packet_queue(s);
if (!(s->iformat->flags & AVFMT_NOFILE))
url_fclose(s->pb);
av_freep(&s->priv_data);
av_free(s);
}
void av_close_input_file(AVFormatContext *s)
{
ByteIOContext *pb = s->iformat->flags & AVFMT_NOFILE ? NULL : s->pb;
av_close_input_stream(s);
if (pb)
url_fclose(pb);
}
AVStream *av_new_stream(AVFormatContext *s, int id)
{
AVStream *st;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment