[Ffmpeg-cvslog] CVS: ffmpeg/libavformat grab.c,1.42,1.43
Luca Abeni CVS
lucabe
Mon Mar 13 10:47:39 CET 2006
Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv13231/libavformat
Modified Files:
grab.c
Log Message:
Tell the user why video capture is failing
Index: grab.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/grab.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- grab.c 11 Mar 2006 00:22:21 -0000 1.42
+++ grab.c 13 Mar 2006 09:47:37 -0000 1.43
@@ -68,16 +68,24 @@
const char *video_device;
int j;
- if (ap->width <= 0 || ap->height <= 0 || ap->time_base.den <= 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);
+
return -1;
+ }
width = ap->width;
height = ap->height;
frame_rate = ap->time_base.den;
frame_rate_base = ap->time_base.num;
- if((unsigned)width > 32767 || (unsigned)height > 32767)
+ if((unsigned)width > 32767 || (unsigned)height > 32767) {
+ av_log(s1, AV_LOG_ERROR, "Capture size is out of range: %dx%d\n",
+ width, height);
+
return -1;
+ }
st = av_new_stream(s1, 0);
if (!st)
More information about the ffmpeg-cvslog
mailing list