lavf/segment: add error log in case of invalid filename template
authorStefano Sabatini <stefasab@gmail.com>
Tue, 17 Jan 2012 18:50:12 +0000 (19:50 +0100)
committerStefano Sabatini <stefasab@gmail.com>
Tue, 3 Jul 2012 21:26:07 +0000 (23:26 +0200)
Better rather than silently exit.

libavformat/segment.c

index 3212826..e98f9b4 100644 (file)
@@ -54,8 +54,10 @@ static int segment_start(AVFormatContext *s)
         seg->number %= seg->wrap;
 
     if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
-                              s->filename, seg->number++) < 0)
+                              s->filename, seg->number++) < 0) {
+        av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s'\n", s->filename);
         return AVERROR(EINVAL);
+    }
 
     if ((err = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE,
                           &s->interrupt_callback, NULL)) < 0)