]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Distinguish the error reporting for the cases of wrong size and wrong
authorstefano <stefano@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 6 Aug 2008 18:21:35 +0000 (18:21 +0000)
committerstefano <stefano@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 6 Aug 2008 18:21:35 +0000 (18:21 +0000)
timebase in the video4linux2 v4l2_read_header() function.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14647 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavdevice/v4l2.c

index 460fdb037e6431b629f9e4a30215c51f6fba29b8..f1aad381350ee7de82eb31dac50617335ebf0c6d 100644 (file)
@@ -495,9 +495,12 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
     int res, frame_rate, frame_rate_base;
     uint32_t desired_format, capabilities;
 
-    if (ap->width <= 0 || ap->height <= 0 || ap->time_base.den <= 0) {
-        av_log(s1, AV_LOG_ERROR, "Missing/Wrong width, height or framerate\n");
-
+    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;
     }