[FFmpeg-devel] [PATCH] avformat/utils.c: allows av_read_frame to return after a timeout period.

gga ggarra13 at gmail.com
Sat Nov 30 01:50:10 EET 2019


On 29/11/19 15:35, Michael Niedermayer wrote:

> also, do we have a testcase where this loop hangs ?
> if not please provide a testcase
I don't have an easy testcase, but it can be seen with any rtmp stream.  
A full test case can be reproduced like this:

Compile and create a nginx server like it is specified here:

  https://github.com/arut/nginx-rtmp-module/wiki/Getting-started-with-nginx-rtmp

Start the nginx server:
/usr/local/nginx/sbin/nginx

Start ffmpeg streaming:
ffmpeg -re -i long.mov -c copy -f flv rtmp://localhost/myapp/mystream

In another window, play the stream:
ffplay rtmp://localhost/myapp/mystream

Now, abort the ffmpeg process by CTRL-C.  ffplay will eventually hang 
and not allow it to close it when clicking on the close window button.  
With the patch, ffplay will eventually become responsive once again 
after the timeout period.


More information about the ffmpeg-devel mailing list