aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2008-08-06 18:20:04 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2008-08-06 18:20:04 +0000
commite78d651f065c9c6f43b06851026c554f5da682f5 (patch)
treed2db89e322ef9eeac13f49202c903c1952d18c9c
parentc3b9f5fbce8affa618577932eceea37af7f544c5 (diff)
downloadffmpeg-e78d651f065c9c6f43b06851026c554f5da682f5.tar.gz
Distinguish the error reporting for the cases of wrong size and wrong
timebase in the video4linux grab_read_header() function. Originally committed as revision 14646 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavdevice/v4l.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c
index 8fed08c11d..de5080c85e 100644
--- a/libavdevice/v4l.c
+++ b/libavdevice/v4l.c
@@ -78,10 +78,12 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
int j;
int vformat_num = sizeof(video_formats) / sizeof(video_formats[0]);
- if (ap->width <= 0 || ap->height <= 0 || ap->time_base.den <= 0) {
- av_log(s1, AV_LOG_ERROR, "Bad capture size (%dx%d) or wrong time base (%d)\n",
- ap->width, ap->height, ap->time_base.den);
-
+ if (ap->width <= 0 || ap->height <= 0) {
+ av_log(s1, AV_LOG_ERROR, "Wrong size (%dx%d)\n", ap->width, ap->height);
+ return -1;
+ }
+ if (ap->time_base.den <= 0) {
+ av_log(s1, AV_LOG_ERROR, "Wrong time base (%d)\n", ap->time_base.den);
return -1;
}