[FFmpeg-devel] [PATCH] add timeout to udp_read

Michael Niedermayer michaelni
Sun Dec 27 04:13:31 CET 2009


On Fri, Dec 25, 2009 at 10:28:11PM +0100, Stefano Sabatini wrote:
> On date Monday 2009-11-16 01:18:08 +0100, Michael Niedermayer encoded:
> > On Mon, Nov 16, 2009 at 01:00:57AM +0100, Stefano Sabatini wrote:
> > [...]
> > > Please make more clear this sentence.
> > 
> > Please, more clear this sentance make as well.
> 
> Patch updated, with some namespace / docs clarification added.
> 
> Regards.
> -- 
> FFmpeg = Fantastic Forgiving Multimedia Pacific Embarassing Glue

>  doc/ffplay-doc.texi |    3 +++
>  ffplay.c            |   20 ++++++++++++++++++++
>  2 files changed, 23 insertions(+)
> 6d9dc04a7444b3158845d5d63f6a4fa08c14d116  implement-ffplay-nto-opt.patch
> Index: ffmpeg/doc/ffplay-doc.texi
> ===================================================================
> --- ffmpeg.orig/doc/ffplay-doc.texi	2009-12-25 21:26:01.000000000 +0100
> +++ ffmpeg/doc/ffplay-doc.texi	2009-12-25 21:54:54.000000000 +0100
> @@ -95,6 +95,9 @@
>  refers to the list of all the input subtitle streams. If it is greater
>  than the number of subtitle streams minus one, then the last one is
>  selected, if it is negative the subtitle rendering is disabled.
> + at item -nto @var{timeout}
> +Set network timeout in milliseconds, used when opening a network stream. If the
> +timeout will expire the opening operation shall be aborted.
>  @end table
>  
>  @section While playing
> Index: ffmpeg/ffplay.c
> ===================================================================
> --- ffmpeg.orig/ffplay.c	2009-12-25 21:25:26.000000000 +0100
> +++ ffmpeg/ffplay.c	2009-12-25 22:26:13.000000000 +0100
> @@ -1866,9 +1866,19 @@
>  /* since we have only one decoding thread, we can use a global
>     variable instead of a thread local variable */
>  static VideoState *global_video_state;
> +static int64_t nto_reference_time = 0;

> +static int64_t nto = INT64_MAX;

please dont name  global variables like this
instead use a descriptive name that is made of things that one can find
in a english dictionary

[...]
> @@ -2454,6 +2466,13 @@
>      return 0;
>  }
>  
> +static int opt_nto(const char *opt, const char *arg)
> +{
> +    /* reduced max boundary due to the precision of double at INT64_MAX */
> +    nto = parse_number_or_die(opt, arg, OPT_INT64, 0, INT64_MAX - 20000);
> +    return 0;
> +}
> +
>  static const OptionDef options[] = {
>  #include "cmdutils_common_opts.h"
>      { "x", HAS_ARG | OPT_FUNC2, {(void*)opt_width}, "force displayed width", "width" },
> @@ -2486,6 +2505,7 @@
>      { "ec", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&error_concealment}, "set error concealment options",  "bit_mask" },
>      { "sync", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_sync}, "set audio-video sync. type (type=audio/video/ext)", "type" },
>      { "threads", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },
> +    { "nto", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)&opt_nto}, "set network timeout in milliseconds, used when opening a network stream", "timeout" },
>      { "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
>      { NULL, },
>  };

this stuff belongs in common code hmm didnt i say that alraedy?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091227/e659e15a/attachment.pgp>



More information about the ffmpeg-devel mailing list