[FFmpeg-cvslog] avdevice/fbdev: use AV_OPT_TYPE_VIDEO_RATE

Paul B Mahol git at videolan.org
Fri Jul 26 17:29:47 CEST 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Jul 26 15:20:13 2013 +0000| [2634af575c2de0da9b2f29b24c6fb3681d7040ff] | committer: Paul B Mahol

avdevice/fbdev: use AV_OPT_TYPE_VIDEO_RATE

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2634af575c2de0da9b2f29b24c6fb3681d7040ff
---

 libavdevice/fbdev.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c
index 99e779d..74f36d0 100644
--- a/libavdevice/fbdev.c
+++ b/libavdevice/fbdev.c
@@ -80,7 +80,6 @@ typedef struct {
     AVClass *class;          ///< class for private options
     int frame_size;          ///< size in bytes of a grabbed frame
     AVRational framerate_q;  ///< framerate
-    char *framerate;         ///< framerate string set by a private option
     int64_t time_frame;      ///< time for the next frame to output (in 1/1000000 units)
 
     int fd;                  ///< framebuffer device file descriptor
@@ -101,12 +100,6 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx)
     enum AVPixelFormat pix_fmt;
     int ret, flags = O_RDONLY;
 
-    ret = av_parse_video_rate(&fbdev->framerate_q, fbdev->framerate);
-    if (ret < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", fbdev->framerate);
-        return ret;
-    }
-
     if (!(st = avformat_new_stream(avctx, NULL)))
         return AVERROR(ENOMEM);
     avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in microseconds */
@@ -246,7 +239,7 @@ static av_cold int fbdev_read_close(AVFormatContext *avctx)
 #define OFFSET(x) offsetof(FBDevContext, x)
 #define DEC AV_OPT_FLAG_DECODING_PARAM
 static const AVOption options[] = {
-    { "framerate","", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
+    { "framerate","", OFFSET(framerate_q), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, DEC },
     { NULL },
 };
 



More information about the ffmpeg-cvslog mailing list