[FFmpeg-cvslog] Add 'timeout' option to UDP protocol
Andrey Utkin
git at videolan.org
Wed Aug 29 01:10:26 CEST 2012
ffmpeg | branch: master | Andrey Utkin <andrey.krieger.utkin at gmail.com> | Mon Aug 27 16:31:09 2012 +0300| [028b6d2b5cf6a6dc593921c4ceab60a747eccf71] | committer: Michael Niedermayer
Add 'timeout' option to UDP protocol
This patch accepts 'timeout' option for input mode only. As far as i know, UDP output cannot introduce delays.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=028b6d2b5cf6a6dc593921c4ceab60a747eccf71
---
doc/protocols.texi | 3 +++
libavformat/udp.c | 2 ++
2 files changed, 5 insertions(+)
diff --git a/doc/protocols.texi b/doc/protocols.texi
index 883c2e4..0ad985c 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -694,6 +694,9 @@ packets with size of 188 bytes. If not specified defaults to 7*4096.
@item overrun_nonfatal=@var{1|0}
Survive in case of UDP receiving circular buffer overrun. Default
value is 0.
+
+ at item timeout=@var{microseconds}
+In read mode: if no data arrived in more than this time interval, raise error.
@end table
Some usage examples of the UDP protocol with @command{ffmpeg} follow.
diff --git a/libavformat/udp.c b/libavformat/udp.c
index f93c607..c1973a0 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -549,6 +549,8 @@ static int udp_open(URLContext *h, const char *uri, int flags)
break;
}
}
+ if (!is_output && av_find_info_tag(buf, sizeof(buf), "timeout", p))
+ h->rw_timeout = strtol(buf, NULL, 10);
}
/* fill the dest addr */
More information about the ffmpeg-cvslog
mailing list