summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-01-06 01:01:14 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-01-06 01:01:14 +0000
commit81bd4119652ce3911c6604f3421a46c677d6c10f (patch)
tree0f723455398f263a0d67a1ea152479d5aaa4de44 /libavformat/utils.c
parent29db7c3af4b90f035c175e94df14bc931cfd13a3 (diff)
In av_close_input_stream(), flush the packet queue before to actually
close the stream. This way the flushed packets can still reference the still unclosed format context. In particular this fixes a spurious error issued when closing the video4linux2 buffer in mmap_release_buffer(), which tries to access the file descriptor of an already closed file. Originally committed as revision 26237 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index e1928c4a55..fb93e3b57c 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2544,6 +2544,7 @@ void av_close_input_stream(AVFormatContext *s)
int i;
AVStream *st;
+ flush_packet_queue(s);
if (s->iformat->read_close)
s->iformat->read_close(s);
for(i=0;i<s->nb_streams;i++) {
@@ -2575,7 +2576,6 @@ void av_close_input_stream(AVFormatContext *s)
av_freep(&s->programs[i]);
}
av_freep(&s->programs);
- flush_packet_queue(s);
av_freep(&s->priv_data);
while(s->nb_chapters--) {
#if FF_API_OLD_METADATA