Hi,

On Mon, Apr 18, 2011 at 3:03 AM, Anton Khirnov <[email protected]> wrote:
> From: Stefano Sabatini <[email protected]>
>
> The problem with url_exist() is that it tries to open a resource in
> RDONLY mode. If the file is a FIFO and there is already a reading
> client, the open() call will hang.
>
> By using avio_check() with access mode of 0, the second reading
> process will check if the file exists without attempting to open it,
> thus avoiding the lock.
>
> Fix issue #1663.
>
> Signed-off-by: Anton Khirnov <[email protected]>
> ---
>  ffmpeg.c           |    2 +-
>  ffserver.c         |    4 ++--
>  libavformat/img2.c |    6 +++---
>  3 files changed, 6 insertions(+), 6 deletions(-)

I'm in principle OK with the patch, but would like you to first apply
the AVIO_FLAG_{RD,WR}ONLY patches so that stuff like this ...

> -        if (!url_exist(feed->feed_filename)) {
> +        if (avio_check(feed->feed_filename, AVIO_WRONLY|AVIO_RDWR) <= 0) {

... can be written using AVIO_FLAG_READWRITE.

Otherwise OK.

Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to