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>
| ... | ... |
@@ -79,7 +79,7 @@ static enum PixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *var |
| 79 | 79 |
typedef struct {
|
| 80 | 80 |
AVClass *class; ///< class for private options |
| 81 | 81 |
int frame_size; ///< size in bytes of a grabbed frame |
| 82 |
- AVRational fps; ///< framerate |
|
| 82 |
+ AVRational framerate_q; ///< framerate |
|
| 83 | 83 |
char *framerate; ///< framerate string set by a private option |
| 84 | 84 |
int64_t time_frame; ///< time for the next frame to output (in 1/1000000 units) |
| 85 | 85 |
|
| ... | ... |
@@ -102,14 +102,14 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx, |
| 102 | 102 |
enum PixelFormat pix_fmt; |
| 103 | 103 |
int ret, flags = O_RDONLY; |
| 104 | 104 |
|
| 105 |
- ret = av_parse_video_rate(&fbdev->fps, fbdev->framerate); |
|
| 105 |
+ ret = av_parse_video_rate(&fbdev->framerate_q, fbdev->framerate); |
|
| 106 | 106 |
if (ret < 0) {
|
| 107 | 107 |
av_log(avctx, AV_LOG_ERROR, "Couldn't parse framerate.\n"); |
| 108 | 108 |
return ret; |
| 109 | 109 |
} |
| 110 | 110 |
#if FF_API_FORMAT_PARAMETERS |
| 111 | 111 |
if (ap->time_base.num) |
| 112 |
- fbdev->fps = (AVRational){ap->time_base.den, ap->time_base.num};
|
|
| 112 |
+ fbdev->framerate_q = (AVRational){ap->time_base.den, ap->time_base.num};
|
|
| 113 | 113 |
#endif |
| 114 | 114 |
|
| 115 | 115 |
if (!(st = av_new_stream(avctx, 0))) |
| ... | ... |
@@ -168,15 +168,15 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx, |
| 168 | 168 |
st->codec->width = fbdev->width; |
| 169 | 169 |
st->codec->height = fbdev->heigth; |
| 170 | 170 |
st->codec->pix_fmt = pix_fmt; |
| 171 |
- st->codec->time_base = (AVRational){fbdev->fps.den, fbdev->fps.num};
|
|
| 171 |
+ st->codec->time_base = (AVRational){fbdev->framerate_q.den, fbdev->framerate_q.num};
|
|
| 172 | 172 |
st->codec->bit_rate = |
| 173 |
- fbdev->width * fbdev->heigth * fbdev->bytes_per_pixel * av_q2d(fbdev->fps) * 8; |
|
| 173 |
+ fbdev->width * fbdev->heigth * fbdev->bytes_per_pixel * av_q2d(fbdev->framerate_q) * 8; |
|
| 174 | 174 |
|
| 175 | 175 |
av_log(avctx, AV_LOG_INFO, |
| 176 | 176 |
"w:%d h:%d bpp:%d pixfmt:%s fps:%d/%d bit_rate:%d\n", |
| 177 | 177 |
fbdev->width, fbdev->heigth, fbdev->varinfo.bits_per_pixel, |
| 178 | 178 |
av_pix_fmt_descriptors[pix_fmt].name, |
| 179 |
- fbdev->fps.num, fbdev->fps.den, |
|
| 179 |
+ fbdev->framerate_q.num, fbdev->framerate_q.den, |
|
| 180 | 180 |
st->codec->bit_rate); |
| 181 | 181 |
return 0; |
| 182 | 182 |
|
| ... | ... |
@@ -210,7 +210,7 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt) |
| 210 | 210 |
while (nanosleep(&ts, &ts) < 0 && errno == EINTR); |
| 211 | 211 |
} |
| 212 | 212 |
/* compute the time of the next frame */ |
| 213 |
- fbdev->time_frame += INT64_C(1000000) / av_q2d(fbdev->fps); |
|
| 213 |
+ fbdev->time_frame += INT64_C(1000000) / av_q2d(fbdev->framerate_q); |
|
| 214 | 214 |
|
| 215 | 215 |
if ((ret = av_new_packet(pkt, fbdev->frame_size)) < 0) |
| 216 | 216 |
return ret; |