[FFmpeg-devel] [PATCH] avio: Avoid endless loop in case no data arrives

Andrey Utkin andrey.krieger.utkin at gmail.com
Wed Mar 14 19:31:01 CET 2012


2012/3/14 Nicolas George <nicolas.george at normalesup.org>:
> Le quintidi 25 ventôse, an CCXX, Andrey Utkin a écrit :
>> This prevents situation when you launch ffmpeg or app to read UDP, and no data
>> arrives at all (e.g. wrong port). Also sometimes opening stream fed via UDP is
>> not interruptible. This patch fixes it.
>> In fact, there was 'continue' "short-circuit" above interrupt check. Moved
>> interrupt check to the top of loop.
>
> This does not seem right: the continue is only triggered by EINTR, which is
> is a rather exceptional situation, and should not prevent ff_check_interrupt
> from doing its work in the very next round.
>
> I believe there may be something more complex at work here. Can you post a
> complete command that exhibits the problem?

Try
ffmpeg -i udp://127.0.0.1:10000
without directing any traffic to this local udp port. Then try
terminating it with Ctrl+C.
It will ignore 3 strikes, then it'll shut in hard way on 4th, because
signal hander calls exit() in this case.

BTW there's sth strange with number of strikes, because patched
version reacts to _second_ strike. Also normally-going transcoding
terminates only after second strike.
-- 
Andrey Utkin


More information about the ffmpeg-devel mailing list