[FFmpeg-cvslog] fbdev: prefer "framerate_q" over "fps" in device context

Stefano Sabatini git at videolan.org
Fri Jun 24 03:13:05 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Fri Jun  3 10:31:42 2011 +0200| [a5351720cc2439219bb348efc81ff3df828df2a3] | committer: Anton Khirnov

fbdev: prefer "framerate_q" over "fps" in device context

The variable is used for containing the parsed value of framerate,
using a lexically consistent name eases readability/understanding.

Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

 libavdevice/fbdev.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c
index afd6b94..68a5269 100644
--- a/libavdevice/fbdev.c
+++ b/libavdevice/fbdev.c
@@ -79,7 +79,7 @@ static enum PixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *var
 typedef struct {
     AVClass *class;          ///< class for private options
     int frame_size;          ///< size in bytes of a grabbed frame
-    AVRational fps;          ///< framerate
+    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)
 
@@ -102,14 +102,14 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx,
     enum PixelFormat pix_fmt;
     int ret, flags = O_RDONLY;
 
-    ret = av_parse_video_rate(&fbdev->fps, fbdev->framerate);
+    ret = av_parse_video_rate(&fbdev->framerate_q, fbdev->framerate);
     if (ret < 0) {
         av_log(avctx, AV_LOG_ERROR, "Couldn't parse framerate.\n");
         return ret;
     }
 #if FF_API_FORMAT_PARAMETERS
     if (ap->time_base.num)
-        fbdev->fps = (AVRational){ap->time_base.den, ap->time_base.num};
+        fbdev->framerate_q = (AVRational){ap->time_base.den, ap->time_base.num};
 #endif
 
     if (!(st = av_new_stream(avctx, 0)))
@@ -168,15 +168,15 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx,
     st->codec->width      = fbdev->width;
     st->codec->height     = fbdev->heigth;
     st->codec->pix_fmt    = pix_fmt;
-    st->codec->time_base  = (AVRational){fbdev->fps.den, fbdev->fps.num};
+    st->codec->time_base  = (AVRational){fbdev->framerate_q.den, fbdev->framerate_q.num};
     st->codec->bit_rate   =
-        fbdev->width * fbdev->heigth * fbdev->bytes_per_pixel * av_q2d(fbdev->fps) * 8;
+        fbdev->width * fbdev->heigth * fbdev->bytes_per_pixel * av_q2d(fbdev->framerate_q) * 8;
 
     av_log(avctx, AV_LOG_INFO,
            "w:%d h:%d bpp:%d pixfmt:%s fps:%d/%d bit_rate:%d\n",
            fbdev->width, fbdev->heigth, fbdev->varinfo.bits_per_pixel,
            av_pix_fmt_descriptors[pix_fmt].name,
-           fbdev->fps.num, fbdev->fps.den,
+           fbdev->framerate_q.num, fbdev->framerate_q.den,
            st->codec->bit_rate);
     return 0;
 
@@ -210,7 +210,7 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt)
         while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
     }
     /* compute the time of the next frame */
-    fbdev->time_frame += INT64_C(1000000) / av_q2d(fbdev->fps);
+    fbdev->time_frame += INT64_C(1000000) / av_q2d(fbdev->framerate_q);
 
     if ((ret = av_new_packet(pkt, fbdev->frame_size)) < 0)
         return ret;



More information about the ffmpeg-cvslog mailing list