diff options
Diffstat (limited to 'player/misc.c')
-rw-r--r-- | player/misc.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/player/misc.c b/player/misc.c index e8cebbc2e6..1b265e11fa 100644 --- a/player/misc.c +++ b/player/misc.c @@ -20,7 +20,6 @@ #include <errno.h> #include <assert.h> -#include "config.h" #include "mpv_talloc.h" #include "osdep/io.h" @@ -148,7 +147,12 @@ double get_track_seek_offset(struct MPContext *mpctx, struct track *track) if (track->type == STREAM_AUDIO) return -opts->audio_delay; if (track->type == STREAM_SUB) - return -opts->subs_rend->sub_delay; + { + for (int n = 0; n < num_ptracks[STREAM_SUB]; n++) { + if (mpctx->current_track[n][STREAM_SUB] == track) + return -opts->subs_shared->sub_delay[n]; + } + } } return 0; } @@ -169,6 +173,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, &content_type); +} + void update_vo_playback_state(struct MPContext *mpctx) { if (mpctx->video_out && mpctx->video_out->config_ok) { @@ -234,7 +252,8 @@ void error_on_track(struct MPContext *mpctx, struct track *track) if (track->type == STREAM_VIDEO) MP_INFO(mpctx, "Video: no video\n"); if (mpctx->opts->stop_playback_on_init_failure || - !(mpctx->vo_chain || mpctx->ao_chain)) + (!mpctx->current_track[0][STREAM_AUDIO] && + !mpctx->current_track[0][STREAM_VIDEO])) { if (!mpctx->stop_play) mpctx->stop_play = PT_ERROR; @@ -304,7 +323,7 @@ void merge_playlist_files(struct playlist *pl) edl = talloc_strdup_append_buffer(edl, e->filename); } playlist_clear(pl); - playlist_add_file(pl, edl); + playlist_append_file(pl, edl); talloc_free(edl); } @@ -312,7 +331,6 @@ const char *mp_status_str(enum playback_status st) { switch (st) { case STATUS_SYNCING: return "syncing"; - case STATUS_FILLING: return "filling"; case STATUS_READY: return "ready"; case STATUS_PLAYING: return "playing"; case STATUS_DRAINING: return "draining"; |