[FFmpeg-cvslog] img2: return AVERROR(EINVAL) in case of invalid filename pattern
Stefano Sabatini
git at videolan.org
Thu Apr 21 12:24:50 CEST 2011
ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Mon Apr 11 00:39:59 2011 +0200| [9bf81b49cff3945a76ac776f086a1d1adc120e6d] | committer: Stefano Sabatini
img2: return AVERROR(EINVAL) in case of invalid filename pattern
In write_packet(), return AVERROR(EINVAL) rather than AVERROR(EIO) if
the provided output filename pattern is not valid. Indeed this has to
be considered a configuration error rather than an I/O error.
Allow a less confusing error report.
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9bf81b49cff3945a76ac776f086a1d1adc120e6d
---
libavformat/img2.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavformat/img2.c b/libavformat/img2.c
index bff0601..0de2f8b 100644
--- a/libavformat/img2.c
+++ b/libavformat/img2.c
@@ -366,7 +366,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
av_log(s, AV_LOG_ERROR,
"Could not get frame filename number %d from pattern '%s'\n",
img->img_number, img->path);
- return AVERROR(EIO);
+ return AVERROR(EINVAL);
}
for(i=0; i<3; i++){
if (avio_open(&pb[i], filename, AVIO_FLAG_WRITE) < 0) {
More information about the ffmpeg-cvslog
mailing list