[FFmpeg-cvslog] r26237 - trunk/libavformat/utils.c

stefano subversion
Thu Jan 6 02:01:14 CET 2011


Author: stefano
Date: Thu Jan  6 02:01:14 2011
New Revision: 26237

Log:
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.

Modified:
   trunk/libavformat/utils.c

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	Wed Jan  5 22:23:42 2011	(r26236)
+++ trunk/libavformat/utils.c	Thu Jan  6 02:01:14 2011	(r26237)
@@ -2544,6 +2544,7 @@ void av_close_input_stream(AVFormatConte
     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(AVFormatConte
         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



More information about the ffmpeg-cvslog mailing list