aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2021-03-06 22:53:21 +0100
committerMarton Balint <cus@passwd.hu>2021-03-13 17:36:48 +0100
commit4217e091fefe540a0aab767e4a0a2454808cb4aa (patch)
treedc0ea654c8c65429be9a1805313e4dc0e4e90f4b
parent7b0832dea8fe266011e2891402e091562edbb6ba (diff)
downloadffmpeg-4217e091fefe540a0aab767e4a0a2454808cb4aa.tar.gz
avformat/librist: increase default loglevel
Also remove AV_LOG_SIMULATE from the list as it is not used directly, and do not use panic level on unknown loglevel, but make them warn. Also fix mapping of NOTICE/INFO/VERBOSE and add documentation about when the option should actually be used. Signed-off-by: Marton Balint <cus@passwd.hu>
-rw-r--r--doc/protocols.texi4
-rw-r--r--libavformat/librist.c9
2 files changed, 7 insertions, 6 deletions
diff --git a/doc/protocols.texi b/doc/protocols.texi
index 11005b0849..eaf7b52608 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -718,7 +718,9 @@ Set internal RIST buffer size for retransmission of data.
Set maximum packet size for sending data. 1316 by default.
@item log_level
-Set loglevel for RIST logging messages.
+Set loglevel for RIST logging messages. You only need to set this if you
+explicitly want to enable debug level messages or packet loss simulation,
+otherwise the regular loglevel is respected.
@item secret
Set override of encryption secret, by default is unset.
diff --git a/libavformat/librist.c b/libavformat/librist.c
index 2fb3162f86..2296bfa079 100644
--- a/libavformat/librist.c
+++ b/libavformat/librist.c
@@ -64,7 +64,7 @@ static const AVOption librist_options[] = {
{ "advanced", NULL, 0, AV_OPT_TYPE_CONST, {.i64=RIST_PROFILE_ADVANCED}, 0, 0, .flags = D|E, "profile" },
{ "buffer_size", "set buffer_size", OFFSET(buffer_size), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, .flags = D|E },
{ "pkt_size", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64=1316}, 1, MAX_PAYLOAD_SIZE, .flags = D|E },
- { "log_level", "set loglevel", OFFSET(log_level), AV_OPT_TYPE_INT, {.i64=-1}, -1, INT_MAX, .flags = D|E },
+ { "log_level", "set loglevel", OFFSET(log_level), AV_OPT_TYPE_INT, {.i64=RIST_LOG_INFO}, -1, INT_MAX, .flags = D|E },
{ "secret", "set encryption secret",OFFSET(secret), AV_OPT_TYPE_STRING,{.str=NULL}, 0, 0, .flags = D|E },
{ "encryption","set encryption type",OFFSET(encryption), AV_OPT_TYPE_INT ,{.i64=0}, 0, INT_MAX, .flags = D|E },
{ NULL }
@@ -87,12 +87,11 @@ static int log_cb(void *arg, enum rist_log_level log_level, const char *msg)
switch (log_level) {
case RIST_LOG_ERROR: level = AV_LOG_ERROR; break;
case RIST_LOG_WARN: level = AV_LOG_WARNING; break;
- case RIST_LOG_NOTICE: level = AV_LOG_VERBOSE; break;
- case RIST_LOG_INFO: level = AV_LOG_INFO; break;
+ case RIST_LOG_NOTICE: level = AV_LOG_INFO; break;
+ case RIST_LOG_INFO: level = AV_LOG_VERBOSE; break;
case RIST_LOG_DEBUG: level = AV_LOG_DEBUG; break;
case RIST_LOG_DISABLE: level = AV_LOG_QUIET; break;
- case RIST_LOG_SIMULATE: level = AV_LOG_TRACE; break;
- default: level = AV_LOG_PANIC;
+ default: level = AV_LOG_WARNING;
}
av_log(arg, level, "%s", msg);