diff options
author | Luca Abeni <lucabe72@email.it> | 2006-03-13 09:47:37 +0000 |
---|---|---|
committer | Luca Abeni <lucabe72@email.it> | 2006-03-13 09:47:37 +0000 |
commit | 11b9c0f4d34f4f916077697f5796d81a56dec2a6 (patch) | |
tree | b1544d71e398ee0ebcbf93df8eec2fa355cad914 /libavformat | |
parent | 0816152af912805dcd6bb24e6fd1f3d2ed59a717 (diff) | |
download | ffmpeg-11b9c0f4d34f4f916077697f5796d81a56dec2a6.tar.gz |
Tell the user why video capture is failing
Originally committed as revision 5160 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/grab.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libavformat/grab.c b/libavformat/grab.c index 8b81183323..e16ea7b875 100644 --- a/libavformat/grab.c +++ b/libavformat/grab.c @@ -68,16 +68,24 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) 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) |