summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--player/core.h1
-rw-r--r--player/misc.c14
-rw-r--r--player/playloop.c2
-rw-r--r--player/video.c1
-rw-r--r--video/out/vo.h9
5 files changed, 27 insertions, 0 deletions
diff --git a/player/core.h b/player/core.h
index c4a75aa25c..916a617832 100644
--- a/player/core.h
+++ b/player/core.h
@@ -556,6 +556,7 @@ double get_play_end_pts(struct MPContext *mpctx);
double get_play_start_pts(struct MPContext *mpctx);
bool get_ab_loop_times(struct MPContext *mpctx, double t[2]);
void merge_playlist_files(struct playlist *pl);
+void update_content_type(struct MPContext *mpctx, struct track *track);
void update_vo_playback_state(struct MPContext *mpctx);
void update_window_title(struct MPContext *mpctx, bool force);
void error_on_track(struct MPContext *mpctx, struct track *track);
diff --git a/player/misc.c b/player/misc.c
index 80d6e5453a..6f3f98cd49 100644
--- a/player/misc.c
+++ b/player/misc.c
@@ -169,6 +169,20 @@ void issue_refresh_seek(struct MPContext *mpctx, enum seek_precision min_prec)
queue_seek(mpctx, MPSEEK_ABSOLUTE, get_current_time(mpctx), min_prec, 0);
}
+void update_content_type(struct MPContext *mpctx, struct track *track)
+{
+ enum mp_content_type content_type;
+ if (!track || !track->vo_c) {
+ content_type = MP_CONTENT_NONE;
+ } else if (track->image) {
+ content_type = MP_CONTENT_IMAGE;
+ } else {
+ content_type = MP_CONTENT_VIDEO;
+ }
+ if (mpctx->video_out)
+ vo_control(mpctx->video_out, VOCTRL_CONTENT_TYPE, (void *)content_type);
+}
+
void update_vo_playback_state(struct MPContext *mpctx)
{
if (mpctx->video_out && mpctx->video_out->config_ok) {
diff --git a/player/playloop.c b/player/playloop.c
index 91badf0647..8b0d017f9f 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -1036,6 +1036,8 @@ int handle_force_window(struct MPContext *mpctx, bool force)
};
if (vo_reconfig(vo, &p) < 0)
goto err;
+ struct track *track = mpctx->current_track[0][STREAM_VIDEO];
+ update_content_type(mpctx, track);
update_screensaver_state(mpctx);
vo_set_paused(vo, true);
vo_redraw(vo);
diff --git a/player/video.c b/player/video.c
index 6400979438..f7a31efd7a 100644
--- a/player/video.c
+++ b/player/video.c
@@ -276,6 +276,7 @@ void reinit_video_chain_src(struct MPContext *mpctx, struct track *track)
if (!recreate_video_filters(mpctx))
goto err_out;
+ update_content_type(mpctx, track);
update_screensaver_state(mpctx);
vo_set_paused(vo_c->vo, get_internal_paused(mpctx));
diff --git a/video/out/vo.h b/video/out/vo.h
index 8ccfe3ccfe..c7ac9c9c59 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -95,6 +95,8 @@ enum mp_voctrl {
VOCTRL_SET_CURSOR_VISIBILITY, // bool*
+ VOCTRL_CONTENT_TYPE, // enum mp_content_type*
+
VOCTRL_KILL_SCREENSAVER,
VOCTRL_RESTORE_SCREENSAVER,
@@ -129,6 +131,13 @@ enum mp_voctrl {
VOCTRL_EXTERNAL_RESIZE,
};
+// Helper to expose what kind of content is curently playing to the VO.
+enum mp_content_type {
+ MP_CONTENT_NONE, // used for force-window
+ MP_CONTENT_IMAGE,
+ MP_CONTENT_VIDEO,
+};
+
#define VO_TRUE true
#define VO_FALSE false
#define VO_ERROR -1