mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-09-11 01:47:55 +02:00
Make av_parse_video_size() and av_parse_video_rate() return
AVERROR(EINVAL) rather than -1 in case of unsuccess. Originally committed as revision 24521 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
b964a2935e
commit
afead10638
@ -107,7 +107,7 @@ int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str)
|
|||||||
frame_height = strtol(p, &p, 10);
|
frame_height = strtol(p, &p, 10);
|
||||||
}
|
}
|
||||||
if (frame_width <= 0 || frame_height <= 0)
|
if (frame_width <= 0 || frame_height <= 0)
|
||||||
return -1;
|
return AVERROR(EINVAL);
|
||||||
*width_ptr = frame_width;
|
*width_ptr = frame_width;
|
||||||
*height_ptr = frame_height;
|
*height_ptr = frame_height;
|
||||||
return 0;
|
return 0;
|
||||||
@ -145,6 +145,6 @@ int av_parse_video_rate(AVRational *frame_rate, const char *arg)
|
|||||||
frame_rate->num = time_base.num;
|
frame_rate->num = time_base.num;
|
||||||
}
|
}
|
||||||
if (frame_rate->num <= 0 || frame_rate->den <= 0)
|
if (frame_rate->num <= 0 || frame_rate->den <= 0)
|
||||||
return -1;
|
return AVERROR(EINVAL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user