[FFmpeg-cvslog] lavdev: improve feedback in case of invalid frame rate/size
Stefano Sabatini
git at videolan.org
Fri Jun 24 03:13:06 CEST 2011
ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Fri Jun 3 10:50:28 2011 +0200| [41b68dce4d148b6a227d001b32deb275c01aa550] | committer: Anton Khirnov
lavdev: improve feedback in case of invalid frame rate/size
Show the invalid string in the error message.
While at it also prefer "Could not" over "Couldn't", plain forms are
preferred over contractions (simplify readability, especially for non
English-savvy people).
Signed-off-by: Anton Khirnov <anton at khirnov.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=41b68dce4d148b6a227d001b32deb275c01aa550
---
libavdevice/bktr.c | 4 ++--
libavdevice/fbdev.c | 2 +-
libavdevice/libdc1394.c | 4 ++--
libavdevice/v4l2.c | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c
index aa3055d..f1ae9ea 100644
--- a/libavdevice/bktr.c
+++ b/libavdevice/bktr.c
@@ -263,7 +263,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
#endif
if ((ret = av_parse_video_size(&width, &height, s->video_size)) < 0) {
- av_log(s1, AV_LOG_ERROR, "Couldn't parse video size.\n");
+ av_log(s1, AV_LOG_ERROR, "Could not parse video size '%s'.\n", s->video_size);
goto out;
}
@@ -278,7 +278,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
goto out;
}
if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) {
- av_log(s1, AV_LOG_ERROR, "Couldn't parse framerate.\n");
+ av_log(s1, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", s->framerate);
goto out;
}
#if FF_API_FORMAT_PARAMETERS
diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c
index 68a5269..2f3e0ff 100644
--- a/libavdevice/fbdev.c
+++ b/libavdevice/fbdev.c
@@ -104,7 +104,7 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx,
ret = av_parse_video_rate(&fbdev->framerate_q, fbdev->framerate);
if (ret < 0) {
- av_log(avctx, AV_LOG_ERROR, "Couldn't parse framerate.\n");
+ av_log(avctx, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", fbdev->framerate);
return ret;
}
#if FF_API_FORMAT_PARAMETERS
diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c
index 622579b..bf4e27e 100644
--- a/libavdevice/libdc1394.c
+++ b/libavdevice/libdc1394.c
@@ -134,11 +134,11 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap,
}
if ((ret = av_parse_video_size(&width, &height, dc1394->video_size)) < 0) {
- av_log(c, AV_LOG_ERROR, "Couldn't parse video size.\n");
+ av_log(c, AV_LOG_ERROR, "Could not parse video size '%s'.\n", dc1394->video_size);
goto out;
}
if ((ret = av_parse_video_rate(&framerate, dc1394->framerate)) < 0) {
- av_log(c, AV_LOG_ERROR, "Couldn't parse framerate.\n");
+ av_log(c, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", dc1394->framerate);
goto out;
}
#if FF_API_FORMAT_PARAMETERS
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index b024c48..072be48 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -460,7 +460,7 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap)
streamparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (s->framerate && (ret = av_parse_video_rate(&framerate_q, s->framerate)) < 0) {
- av_log(s1, AV_LOG_ERROR, "Couldn't parse framerate.\n");
+ av_log(s1, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", s->framerate);
return ret;
}
#if FF_API_FORMAT_PARAMETERS
@@ -601,7 +601,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
if (s->video_size && (res = av_parse_video_size(&s->width, &s->height, s->video_size)) < 0) {
- av_log(s1, AV_LOG_ERROR, "Couldn't parse video size.\n");
+ av_log(s1, AV_LOG_ERROR, "Could not parse video size '%s'.\n", s->video_size);
goto out;
}
if (s->pixel_format && (pix_fmt = av_get_pix_fmt(s->pixel_format)) == PIX_FMT_NONE) {
More information about the ffmpeg-cvslog
mailing list