[FFmpeg-devel] [PATCH] rtsp: add option to set the socket timeout of the lower protocol.

Michael Niedermayer michaelni at gmx.at
Mon Apr 8 17:47:39 CEST 2013


On Mon, Apr 08, 2013 at 08:34:12AM +0000, Paul B Mahol wrote:
> On 4/7/13, Michael Niedermayer <michaelni at gmx.at> wrote:
> > Fixes Ticket2294
> >
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavformat/rtsp.c |    4 +++-
> >  libavformat/rtsp.h |    5 +++++
> >  2 files changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> > index fcc134f..dc94f0f 100644
> > --- a/libavformat/rtsp.c
> > +++ b/libavformat/rtsp.c
> > @@ -91,6 +91,7 @@ const AVOption ff_rtsp_options[] = {
> >      { "min_port", "Minimum local UDP port", OFFSET(rtp_port_min),
> > AV_OPT_TYPE_INT, {.i64 = RTSP_RTP_PORT_MIN}, 0, 65535, DEC|ENC },
> >      { "max_port", "Maximum local UDP port", OFFSET(rtp_port_max),
> > AV_OPT_TYPE_INT, {.i64 = RTSP_RTP_PORT_MAX}, 0, 65535, DEC|ENC },
> >      { "timeout", "Maximum timeout (in seconds) to wait for incoming
> > connections. -1 is infinite. Implies flag listen", OFFSET(initial_timeout),
> > AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, DEC },
> > +    { "stimeout", "timeout (in micro seconds) of socket i/o operations.",
> > OFFSET(stimeout), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC },
> >      RTSP_REORDERING_OPTS(),
> >      { NULL },
> >  };
> > @@ -1618,7 +1619,8 @@ redirect:
> >          }
> >      } else {
> >          /* open the tcp connection */
> > -        ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port,
> > NULL);
> > +        ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port,
> > +                    "?timeout=%d", rt->stimeout);
> >          if (ffurl_open(&rt->rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE,
> >                         &s->interrupt_callback, NULL) < 0) {
> >              err = AVERROR(EIO);
> > diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
> > index 321cd7a..4af3507 100644
> > --- a/libavformat/rtsp.h
> > +++ b/libavformat/rtsp.h
> > @@ -391,6 +391,11 @@ typedef struct RTSPState {
> >      int initial_timeout;
> >
> >      /**
> > +     * timeout of socket i/o operations.
> > +     */
> > +    int stimeout;
> > +
> > +    /**
> >       * Size of RTP packet reordering queue.
> >       */
> >      int reordering_queue_size;
> > --
> > 1.7.9.5
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> probably ok

applied

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130408/66c1de9b/attachment.asc>


More information about the ffmpeg-devel mailing list