[FFmpeg-devel] [Patch] no_delay option for librtmp

Michael Niedermayer michaelni at gmx.at
Fri Feb 27 02:42:17 CET 2015


On Thu, Feb 26, 2015 at 03:23:40PM -0600, Cary Tetrick wrote:
> Use this instead. (sorry, corrected grammatical errors.)
> 
> 
> On Thu, Feb 26, 2015 at 1:22 PM, Cary Tetrick <ctetrick2 at gmail.com> wrote:
> 
> > This adds another option to a change authored by Brian Brice <
> > bbrice at gmail.com> 2015-01-19
> >  "librtmp: Allow changing the socket send buffer size"
> >  (Brian is aware of this change).
> >
> >  Unlike a previous patch, this has no dependency on rtmpdump.
> >
> >  Options to the ffmpeg commandline in support of now arguments in librtmp.
> >      rtmp_buffer_size - sets rtmp socket send buffer size in bytes.
> >          this is the same as the patch it replaces.
> >      rtmp_nodelay - on or off. defaults to on.
> >          allows users to control whether nagel is active.
> >
> >  See this thread on Zeranoe forum:
> >  http://ffmpeg.zeranoe.com/forum/viewtopic.php?f=7&t=657&p=7823#p7823
> >
> >  I believe this addresses case 1604 on the ffmpeg tracker.
> >  "Summary of the bug: Rtmp output to justin.tv fps continually drops, ..."
> >  - note the memory problem mentioned had been fixed. This fix only applies
> > if
> >  librtmp is enabled.
> >  https://trac.ffmpeg.org/ticket/1604
> >  Defualt behavior leaves things unchanged. Users must employ options
> > intentionally.
> >
> > My previous patch should be ignored.
> >

>  librtmp.c |   11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 0957935410df54a8122e3cd62d771d87a39c4347  0001-Topic-Option-to-control-no_delay-flag-in-librtmp.patch
> From fe8be0cdb6ed76a67283bb1000585af79b492d4d Mon Sep 17 00:00:00 2001
> From: Cary Tetrick <cary.tetrick at gmail.com>
> Date: Thu, 26 Feb 2015 15:18:47 -0600
> Subject: [PATCH]  Topic: Option to control no_delay flag in librtmp
> 
>  This adds another option to a change authored by Brian Brice <bbrice at gmail.com> 2015-01-19
>  "librtmp: Allow changing the socket send buffer size"
>  (Brian is aware of this change).
> 
>  Unlike a previous patch, this has no dependency on rtmpdump.
> 
>  Options to the ffmpeg commandline in support of now arguments in librtmp.
>      rtmp_buffer_size - sets rtmp socket send buffer size in bytes.
>          this is the same as the patch it replaces.
>      rtmp_nodelay - on or off. defaults to on.
>          allows users to control whether nagel is active.
> 
>  See this thread on Zeranoe forum:
>  http://ffmpeg.zeranoe.com/forum/viewtopic.php?f=7&t=657&p=7823#p7823
> 
>  I believe this addresses case 1604 on the ffmpeg tracker.
>  "Summary of the bug: Rtmp output to justin.tv fps continually drops, ..."
>  - note the memory problem mentioned had been fixed. This fix only applies if
>  librtmp is enabled.
>  https://trac.ffmpeg.org/ticket/1604
> 
>  Defualt behavior leaves things unchanged. Users must employ options intentionally.
> ---
>  libavformat/librtmp.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
> index bfa9a71..64ae59d 100644
> --- a/libavformat/librtmp.c
> +++ b/libavformat/librtmp.c
> @@ -52,6 +52,7 @@ typedef struct LibRTMPContext {
>      int live;
>      char *temp_filename;
>      int buffer_size;
> +    int tcp_nodelay;
>  } LibRTMPContext;
>  
>  static void rtmp_log(int level, const char *fmt, va_list args)
> @@ -239,6 +240,11 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
>          int tmp = ctx->buffer_size;
>          setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_SNDBUF, &tmp, sizeof(tmp));
>      }
> +
> +    if (flags & AVIO_FLAG_WRITE) {
> +        int tmp = ctx->tcp_nodelay;
> +        setsockopt(r->m_sb.sb_socket, IPPROTO_TCP, TCP_NODELAY, &tmp, sizeof(tmp));

does this need any #includes, any checks in configure?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- 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/20150227/dea5e725/attachment.asc>


More information about the ffmpeg-devel mailing list