[FFmpeg-devel] [PATCH] UDP hangs with no input data

Ronald S. Bultje rsbultje
Tue Nov 11 14:58:46 CET 2008


Hi,

On Tue, Nov 11, 2008 at 8:47 AM, Jindrich Makovicka <makovick at gmail.com> wrote:
> when there are no incoming packets on the specified UDP address/port,
> libavformat waits indefinitely, and can be only terminated using
> SIGKILL. The attached patches add
>
> 1) UDP receive timeout, which is 10 seconds by default, and adjustable
> in the URL, and

Can you do something that unifies tcp.c and udp.c behaviour? tcp.c
uses interrupt_cb() (top of tcp_read()) and that callback can
implement a timeout or interrupt signal handler (such as a cancel
button in a UI) or whatever. udp.c might do something like that as
well. there's better approaches, but the two should do the same.

If you like the interrupt_cb() idea (in general), this could be moved
to an instance vfunc callback instead of a global vfunc and/or it
could be given some useful context arguments so we can actually use it
in client code as well (object-based, not ust ffmpeg/ffplay) without
having to access any global arguments at all (similar to av_log
callbacks etc.).

If you do it well, you don't have to edit code to add an interrupt
handler or change the timeout time value or whatever, but you can just
use the instance-specific callback function, implement it one line
differently and you have a configurable timeout, inetrrupt handler et
al at once.

Ronald




More information about the ffmpeg-devel mailing list