diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-06-03 10:31:42 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-06-23 08:49:49 +0200 |
commit | a5351720cc2439219bb348efc81ff3df828df2a3 (patch) | |
tree | 057c6570c43951a6fbaffaacaa3186c93e59f22e /libavdevice/fbdev.c | |
parent | da51a7c69cd105498d28a23f1137eef2915a8e6b (diff) | |
download | ffmpeg-a5351720cc2439219bb348efc81ff3df828df2a3.tar.gz |
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@khirnov.net>
Diffstat (limited to 'libavdevice/fbdev.c')
-rw-r--r-- | libavdevice/fbdev.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c index afd6b94ed0..68a52693fd 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; |