aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2008-08-06 18:21:35 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2008-08-06 18:21:35 +0000
commit99423fa0ee5a70522af0ae92a4720277f0a137fa (patch)
tree8d1a0cb9ea731c198579a4b5a683cb8e0bb5b01e
parente78d651f065c9c6f43b06851026c554f5da682f5 (diff)
downloadffmpeg-99423fa0ee5a70522af0ae92a4720277f0a137fa.tar.gz
Distinguish the error reporting for the cases of wrong size and wrong
timebase in the video4linux2 v4l2_read_header() function. Originally committed as revision 14647 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavdevice/v4l2.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 460fdb037e..f1aad38135 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -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;
}