From 4ae8fc326d544f83777ad4f038ad6587af507fab Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 20 Apr 2015 23:21:38 +0200 Subject: [PATCH] player: cleanup update_fps() function It was called only in 2 places, one of them redundant (the container FPS can not change). --- player/core.h | 1 - player/video.c | 17 +++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/player/core.h b/player/core.h index 9ed452ffad..714fd5d4bd 100644 --- a/player/core.h +++ b/player/core.h @@ -491,7 +491,6 @@ int reinit_video_chain(struct MPContext *mpctx); int reinit_video_filters(struct MPContext *mpctx); void write_video(struct MPContext *mpctx, double endpts); void mp_force_video_refresh(struct MPContext *mpctx); -void update_fps(struct MPContext *mpctx); void uninit_video_out(struct MPContext *mpctx); void uninit_video_chain(struct MPContext *mpctx); diff --git a/player/video.c b/player/video.c index eb8967ce89..78df2b2f0a 100644 --- a/player/video.c +++ b/player/video.c @@ -76,15 +76,6 @@ static const char av_desync_help_text[] = " with --no-video, --no-audio, or --no-sub.\n" "If none of this helps you, file a bug report.\n\n"; -void update_fps(struct MPContext *mpctx) -{ -#if HAVE_ENCODING - struct dec_video *d_video = mpctx->d_video; - if (mpctx->encode_lavc_ctx && d_video) - encode_lavc_set_video_fps(mpctx->encode_lavc_ctx, d_video->fps); -#endif -} - static void set_allowed_vo_formats(struct vf_chain *c, struct vo *vo) { vo_query_formats(vo, c->allowed_output_formats); @@ -303,7 +294,11 @@ int reinit_video_chain(struct MPContext *mpctx) MP_INFO(mpctx, "FPS forced to %5.3f.\n", d_video->fps); MP_INFO(mpctx, "Use --no-correct-pts to force FPS based timing.\n"); } - update_fps(mpctx); + +#if HAVE_ENCODING + if (mpctx->encode_lavc_ctx && d_video) + encode_lavc_set_video_fps(mpctx->encode_lavc_ctx, d_video->fps); +#endif vo_control(mpctx->video_out, VOCTRL_GET_HWDEC_INFO, &d_video->hwdec_info); @@ -771,8 +766,6 @@ void write_video(struct MPContext *mpctx, double endpts) if (mpctx->paused && mpctx->video_status >= STATUS_READY) return; - update_fps(mpctx); - int r = video_output_image(mpctx, endpts); MP_TRACE(mpctx, "video_output_image: %d\n", r);