[FFmpeg-cvslog] ffserver: deprecate inconsistent parsing behavior of Truncate option

Stefano Sabatini git at videolan.org
Fri Nov 29 10:29:16 CET 2013


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Thu Nov 28 22:47:39 2013 +0100| [b1049f89fa48ae9b038516a7194686eebaa25be7] | committer: Stefano Sabatini

ffserver: deprecate inconsistent parsing behavior of Truncate option

Also make it accept the more consistent behavior (boolean option set to
true when specified).

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b1049f89fa48ae9b038516a7194686eebaa25be7
---

 ffserver.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/ffserver.c b/ffserver.c
index a900b94..6ce09c4 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -4232,7 +4232,15 @@ static int parse_ffconfig(const char *filename)
         } else if (!av_strcasecmp(cmd, "Truncate")) {
             if (feed) {
                 get_arg(arg, sizeof(arg), &p);
-                feed->truncate = strtod(arg, NULL);
+                /* assume Truncate is true in case no argument is specified */
+                if (!arg[0]) {
+                    feed->truncate = 1;
+                } else {
+                    av_log(NULL, AV_LOG_WARNING,
+                           "Truncate N syntax in configuration file is deprecated, "
+                           "use Truncate alone with no arguments\n");
+                    feed->truncate = strtod(arg, NULL);
+                }
             }
         } else if (!av_strcasecmp(cmd, "FileMaxSize")) {
             if (feed) {



More information about the ffmpeg-cvslog mailing list