[FFmpeg-cvslog] lavf/segment: add error log in case of invalid filename template

Stefano Sabatini git at videolan.org
Tue Jul 3 23:26:58 CEST 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Tue Jan 17 19:50:12 2012 +0100| [d8013f38ab73b15c5041f2489fc0b8bb45512e24] | committer: Stefano Sabatini

lavf/segment: add error log in case of invalid filename template

Better rather than silently exit.

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

 libavformat/segment.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index 3212826..e98f9b4 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -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)



More information about the ffmpeg-cvslog mailing list