[FFmpeg-devel] RTMP Play file descriptor leak

Michael Niedermayer michaelni at gmx.at
Tue Sep 30 11:25:56 CEST 2014


On Tue, Sep 30, 2014 at 08:01:23PM +1100, Alexander Drozdov wrote:
> Hi!
> 
> In our project we uses FFmpeg to demux RTMP streams. Input stream takes
> from Wowza/nginx-rtmp. Our application is a daemon that try to connect to
> source periodicaly if it does not present (does not published to Wowza, for
> example). We also use interrupt callback to break connection if timeout is
> occured. So in this situation:
> - Alive server
> - Alive streaming application
> - Configured inerrupt callback with timeout
> - Disalive stream
> 
> TCP socket to server does not closes.
> 
> I look into code with debugger and found place where error is occured:
> rtmpproto.c, rtmp_open() L:2672
> 
> Root couse: return from function without resources clean up
> 
> Solution: replace return with 'goto fail'
> 
> Path is attached.
> 
> -- 
> WBR, Alexander Drozdov
> http://htrd.su

>  rtmpproto.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 9c7952d92224b4a905c54b1f6a02dd83e6ea083f  0001-RTMP-fix-FD-leak-in-rtmp_open.patch
> From f742012ea22bf684fe0ae8e153749bd7339503d6 Mon Sep 17 00:00:00 2001
> From: Alexander Drozdov <adrozdoff at gmail.com>
> Date: Fri, 26 Sep 2014 09:45:08 +1100
> Subject: [PATCH] RTMP: fix FD leak in rtmp_open()
> 
> If we setup AVIO interrupt callback and it will be returns 1 on socket
> timeouts and we try to connect to non-existing streams on some servers
> (like nginx-rtmp) we got FD leak.

applied

thanks

PS: i think theres another case in there that needs a similar change

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140930/1513ba0d/attachment.asc>


More information about the ffmpeg-devel mailing list