summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2011-01-05 15:11:16 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2011-01-31 16:03:10 +0200
commit23fdd9463ca2e65f0f8292e4641dcd00b7526d22 (patch)
tree41fcf38102af05fac3da6537bbca5e6cb5b3f15b /stream
parent52ba5ea684a353f7455df036fa0be1c8849d0de5 (diff)
downloadmpv-23fdd9463ca2e65f0f8292e4641dcd00b7526d22.tar.bz2
mpv-23fdd9463ca2e65f0f8292e4641dcd00b7526d22.tar.xz
stream/tvi_v4l2.c: simplify by using getfps helper function
Use getfps helper function everywhere, simplifies code and avoids a possible division by 0. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32755 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/tvi_v4l2.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c
index 90cb1a6567..def59ad40d 100644
--- a/stream/tvi_v4l2.c
+++ b/stream/tvi_v4l2.c
@@ -731,12 +731,7 @@ static int control(priv_t *priv, int cmd, void *arg)
priv->immediate_mode = 1;
return TVI_CONTROL_TRUE;
case TVI_CONTROL_VID_GET_FPS:
- if (!priv->standard.frameperiod.denominator || !priv->standard.frameperiod.numerator) {
- mp_msg(MSGT_TV, MSGL_ERR, "%s: Cannot get fps\n", info.short_name);
- return TVI_CONTROL_FALSE;
- }
- *(float *)arg = (float)priv->standard.frameperiod.denominator /
- priv->standard.frameperiod.numerator;
+ *(float *)arg = getfps(priv);
mp_msg(MSGT_TV, MSGL_V, "%s: get fps: %f\n", info.short_name,
*(float *)arg);
return TVI_CONTROL_TRUE;
@@ -1463,9 +1458,7 @@ static int start(priv_t *priv)
/* setup video parameters */
if (!priv->tv_param->noaudio) {
- if (priv->video_buffer_size_max < (3*priv->standard.frameperiod.denominator) /
- priv->standard.frameperiod.numerator
- *priv->audio_secs_per_block) {
+ if (priv->video_buffer_size_max < 3*getfps(priv)*priv->audio_secs_per_block) {
mp_msg(MSGT_TV, MSGL_ERR, "Video buffer shorter than 3 times audio frame duration.\n"
"You will probably experience heavy framedrops.\n");
}