Commit 9bf81b49 authored by Stefano Sabatini's avatar 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: 's avatarStefano Sabatini <stefano.sabatini-lala@poste.it>
parent 7046b63e
...@@ -366,7 +366,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -366,7 +366,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
av_log(s, AV_LOG_ERROR, av_log(s, AV_LOG_ERROR,
"Could not get frame filename number %d from pattern '%s'\n", "Could not get frame filename number %d from pattern '%s'\n",
img->img_number, img->path); img->img_number, img->path);
return AVERROR(EIO); return AVERROR(EINVAL);
} }
for(i=0; i<3; i++){ for(i=0; i<3; i++){
if (avio_open(&pb[i], filename, AVIO_FLAG_WRITE) < 0) { if (avio_open(&pb[i], filename, AVIO_FLAG_WRITE) < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment