Discussion:
[PATCH] lavf/udp: warn in case the circular_buffer_size or overrun_nonfatal cannot be supported
Stefano Sabatini
2012-07-18 16:45:46 UTC
Permalink
They are only supported if threading is available.
---
libavformat/udp.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index 5b5c7cb..9358c86 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -496,6 +496,9 @@ static int udp_open(URLContext *h, const char *uri, int flags)
/* assume if no digits were found it is a request to enable it */
if (buf == endptr)
s->overrun_nonfatal = 1;
+ if (!HAVE_PTHREAD_CANCEL)
+ av_log(h, AV_LOG_WARNING,
+ "'overrun_nonfatal' option was set but is not supported on this system\n");
}
if (av_find_info_tag(buf, sizeof(buf), "ttl", p)) {
s->ttl = strtol(buf, NULL, 10);
@@ -514,6 +517,9 @@ static int udp_open(URLContext *h, const char *uri, int flags)
}
if (av_find_info_tag(buf, sizeof(buf), "fifo_size", p)) {
s->circular_buffer_size = strtol(buf, NULL, 10)*188;
+ if (!HAVE_PTHREAD_CANCEL)
+ av_log(h, AV_LOG_WARNING,
+ "'circular_buffer_size' option was set but is not supported on this system\n");
}
if (av_find_info_tag(buf, sizeof(buf), "localaddr", p)) {
av_strlcpy(localaddr, buf, sizeof(localaddr));
--
1.7.5.4
Carl Eugen Hoyos
2012-07-18 18:38:39 UTC
Permalink
+ av_log(h, AV_LOG_WARNING,
+ "'overrun_nonfatal' option was set but is not supported on this system\n");
... but libavformat was compiled without pthreads support
?

Carl Eugen
Stefano Sabatini
2012-07-18 22:40:31 UTC
Permalink
Post by Carl Eugen Hoyos
+ av_log(h, AV_LOG_WARNING,
+ "'overrun_nonfatal' option was set but is not supported on this system\n");
... but libavformat was compiled without pthreads support
This implies the knowledge of many facts which are possibly unknown to
the user (OK libavsomething was not compiled with this pthreads stuff,
and then??). Maybe more clear:

"'overrun_nonfatal' option was set but it is not supported on this build (pthread support is required)\n");

This is still not yet completely clear (and assumes the advanced
notion of "build" on the user), but documentation (see other patch)
should clarify this point.
--
FFmpeg = Fast and Fancy Mythic Pitiful Enlightened Gadget
Stefano Sabatini
2012-07-19 07:57:48 UTC
Permalink
Post by Stefano Sabatini
Post by Carl Eugen Hoyos
+ av_log(h, AV_LOG_WARNING,
+ "'overrun_nonfatal' option was set but is not supported on this system\n");
... but libavformat was compiled without pthreads support
This implies the knowledge of many facts which are possibly unknown to
the user (OK libavsomething was not compiled with this pthreads stuff,
"'overrun_nonfatal' option was set but it is not supported on this build (pthread support is required)\n");
I'll apply this variant in a day or so if I read no better suggestions.
Post by Stefano Sabatini
This is still not yet completely clear (and assumes the advanced
notion of "build" on the user), but documentation (see other patch)
should clarify this point.
--
FFmpeg = Fierce and Freak Majestic Prodigious Exuberant Gorilla
Stefano Sabatini
2012-07-19 20:57:26 UTC
Permalink
Post by Stefano Sabatini
Post by Stefano Sabatini
Post by Carl Eugen Hoyos
+ av_log(h, AV_LOG_WARNING,
+ "'overrun_nonfatal' option was set but is not supported on this system\n");
... but libavformat was compiled without pthreads support
This implies the knowledge of many facts which are possibly unknown to
the user (OK libavsomething was not compiled with this pthreads stuff,
"'overrun_nonfatal' option was set but it is not supported on this build (pthread support is required)\n");
I'll apply this variant in a day or so if I read no better suggestions.
Sent.
--
FFmpeg = Faithful Fundamentalist Most Practical Exploitable Glue
Michael Niedermayer
2012-07-18 20:56:12 UTC
Permalink
Post by Stefano Sabatini
They are only supported if threading is available.
---
libavformat/udp.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
once the text is agreed upon the patch LGTM

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

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
Loading...