summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-16 23:14:55 +0200
committerwm4 <wm4@nowhere>2013-07-16 23:14:55 +0200
commita98aad61f854d9a216675dc54096aa39767c4a35 (patch)
treef3f21cd1fcdbc38bfe58e33222446b78350125c7
parent130866e2693ba08f7d00c404a3767f288d0c3faa (diff)
downloadmpv-a98aad61f854d9a216675dc54096aa39767c4a35.tar.bz2
mpv-a98aad61f854d9a216675dc54096aa39767c4a35.tar.xz
core: move video refresh function to mplayer.c
-rw-r--r--core/command.c7
-rw-r--r--core/mp_core.h1
-rw-r--r--core/mplayer.c10
3 files changed, 13 insertions, 5 deletions
diff --git a/core/command.c b/core/command.c
index cba9ef5a9a..af5e24d494 100644
--- a/core/command.c
+++ b/core/command.c
@@ -1909,7 +1909,6 @@ static void change_video_filters(MPContext *mpctx, const char *cmd,
struct m_obj_settings *old_vf_settings = NULL;
bool success = false;
bool need_refresh = false;
- double refresh_pts = mpctx->last_vo_pts;
// The option parser is used to modify the filter list itself.
char optname[20];
@@ -1931,10 +1930,8 @@ static void change_video_filters(MPContext *mpctx, const char *cmd,
}
m_option_free(type, &old_vf_settings);
- // Try to refresh the video by doing a precise seek to the currently
- // displayed frame.
- if (need_refresh && opts->pause)
- queue_seek(mpctx, MPSEEK_ABSOLUTE, refresh_pts, 1);
+ if (need_refresh)
+ mp_force_video_refresh(mpctx);
}
void run_command(MPContext *mpctx, mp_cmd_t *cmd)
diff --git a/core/mp_core.h b/core/mp_core.h
index 6bd51cb85c..f7e6786b60 100644
--- a/core/mp_core.h
+++ b/core/mp_core.h
@@ -321,6 +321,7 @@ struct playlist_entry *mp_next_file(struct MPContext *mpctx, int direction);
int mp_get_cache_percent(struct MPContext *mpctx);
void mp_write_watch_later_conf(struct MPContext *mpctx);
void mp_set_playlist_entry(struct MPContext *mpctx, struct playlist_entry *e);
+void mp_force_video_refresh(struct MPContext *mpctx);
void mp_print_version(int always);
diff --git a/core/mplayer.c b/core/mplayer.c
index f7a0b701dc..363d89cc53 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -2379,6 +2379,16 @@ no_video:
return 0;
}
+// Try to refresh the video by doing a precise seek to the currently displayed
+// frame. This can go wrong in all sorts of ways, so use sparingly.
+void mp_force_video_refresh(struct MPContext *mpctx)
+{
+ struct MPOpts *opts = &mpctx->opts;
+
+ if (opts->pause && mpctx->last_vo_pts != MP_NOPTS_VALUE)
+ queue_seek(mpctx, MPSEEK_ABSOLUTE, mpctx->last_vo_pts, 1);
+}
+
static void add_frame_pts(struct MPContext *mpctx, double pts)
{
if (pts == MP_NOPTS_VALUE || mpctx->hrseek_framedrop) {