mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-11-02 13:24:20 +08:00
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
This commit is contained in:
@@ -2544,6 +2544,7 @@ void av_close_input_stream(AVFormatContext *s)
|
|||||||
int i;
|
int i;
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
|
|
||||||
|
flush_packet_queue(s);
|
||||||
if (s->iformat->read_close)
|
if (s->iformat->read_close)
|
||||||
s->iformat->read_close(s);
|
s->iformat->read_close(s);
|
||||||
for(i=0;i<s->nb_streams;i++) {
|
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[i]);
|
||||||
}
|
}
|
||||||
av_freep(&s->programs);
|
av_freep(&s->programs);
|
||||||
flush_packet_queue(s);
|
|
||||||
av_freep(&s->priv_data);
|
av_freep(&s->priv_data);
|
||||||
while(s->nb_chapters--) {
|
while(s->nb_chapters--) {
|
||||||
#if FF_API_OLD_METADATA
|
#if FF_API_OLD_METADATA
|
||||||
|
|||||||
Reference in New Issue
Block a user