summaryrefslogtreecommitdiffstats
path: root/core/mplayer.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-04 22:21:57 +0100
committerwm4 <wm4@nowhere>2013-03-04 22:21:57 +0100
commit7889e38f21a4ed65f020a1805b799478f1ad6e55 (patch)
treec63fc87cdf380117e8a2fbe035f11862c1c485c0 /core/mplayer.c
parent6ef1a1cddd9ae43c80a337b5224955735b987074 (diff)
downloadmpv-7889e38f21a4ed65f020a1805b799478f1ad6e55.tar.bz2
mpv-7889e38f21a4ed65f020a1805b799478f1ad6e55.tar.xz
Remove vo_fps global variable
This is needed by the encode stuff for some reason, so we have to explicitly pass it. Functionality shouldn't change.
Diffstat (limited to 'core/mplayer.c')
-rw-r--r--core/mplayer.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index b56415151d..d217f98932 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -2314,6 +2314,15 @@ static void vo_update_window_title(struct MPContext *mpctx)
mpctx->video_out->window_title = talloc_steal(mpctx, title);
}
+static void update_fps(struct MPContext *mpctx)
+{
+#ifdef CONFIG_ENCODING
+ struct sh_video *sh_video = mpctx->sh_video;
+ if (mpctx->encode_lavc_ctx && sh_video)
+ encode_lavc_set_video_fps(mpctx->encode_lavc_ctx, sh_video->fps);
+#endif
+}
+
int reinit_video_chain(struct MPContext *mpctx)
{
struct MPOpts *opts = &mpctx->opts;
@@ -2338,7 +2347,7 @@ int reinit_video_chain(struct MPContext *mpctx)
mpctx->sh_video->fps = force_fps;
mpctx->sh_video->frametime = 1.0f / mpctx->sh_video->fps;
}
- vo_fps = mpctx->sh_video->fps;
+ update_fps(mpctx);
if (!mpctx->sh_video->fps && !force_fps && !opts->correct_pts) {
mp_tmsg(MSGT_CPLAYER, MSGL_ERR, "FPS not specified in the "
@@ -2453,7 +2462,7 @@ static double update_video_nocorrect_pts(struct MPContext *mpctx)
if (mpctx->sh_audio)
mpctx->delay -= frame_time;
// video_read_frame can change fps (e.g. for ASF video)
- vo_fps = sh_video->fps;
+ update_fps(mpctx);
int framedrop_type = check_framedrop(mpctx, frame_time);
void *decoded_frame;
@@ -3215,7 +3224,7 @@ static void run_playloop(struct MPContext *mpctx)
double buffered_audio = -1;
while (mpctx->sh_video) { // never loops, for "break;" only
struct vo *vo = mpctx->video_out;
- vo_fps = mpctx->sh_video->fps;
+ update_fps(mpctx);
video_left = vo->hasframe || vo->frame_loaded;
if (!vo->frame_loaded && (!mpctx->paused || mpctx->restart_playback)) {