mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 15:52:25 +00:00
player: make the osd-msg prefix work for playlist_next/prev
If input.conf e.g. contains "n osd-msg playlist_next", then pressing the n key will switch to the next file, and display the filename on OSD.
This commit is contained in:
parent
d4cc41bbcd
commit
88762cd6a7
@ -4060,6 +4060,8 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
||||
mpctx->playlist->current = e;
|
||||
mpctx->playlist->current_was_replaced = false;
|
||||
mpctx->stop_play = PT_CURRENT_ENTRY;
|
||||
if (on_osd & MP_ON_OSD_MSG)
|
||||
mpctx->add_osd_seek_info |= OSD_SEEK_INFO_CURRENT_FILE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,7 @@ enum mp_osd_seek_info {
|
||||
OSD_SEEK_INFO_TEXT = 2,
|
||||
OSD_SEEK_INFO_CHAPTER_TEXT = 4,
|
||||
OSD_SEEK_INFO_EDITION = 8,
|
||||
OSD_SEEK_INFO_CURRENT_FILE = 16,
|
||||
};
|
||||
|
||||
|
||||
|
@ -917,7 +917,7 @@ static void play_current_file(struct MPContext *mpctx)
|
||||
mpctx->filename = talloc_strdup(tmp, mpctx->playing->filename);
|
||||
mpctx->stream_open_filename = mpctx->filename;
|
||||
|
||||
mpctx->add_osd_seek_info &= OSD_SEEK_INFO_EDITION;
|
||||
mpctx->add_osd_seek_info &= OSD_SEEK_INFO_EDITION | OSD_SEEK_INFO_CURRENT_FILE;
|
||||
|
||||
if (opts->reset_options) {
|
||||
for (int n = 0; opts->reset_options[n]; n++) {
|
||||
|
@ -452,6 +452,12 @@ static void add_seek_osd_messages(struct MPContext *mpctx)
|
||||
mpctx->master_demuxer->edition + 1,
|
||||
mpctx->master_demuxer->num_editions);
|
||||
}
|
||||
if (mpctx->add_osd_seek_info & OSD_SEEK_INFO_CURRENT_FILE) {
|
||||
if (mpctx->filename) {
|
||||
set_osd_msg(mpctx, 1, mpctx->opts->osd_duration, "%s",
|
||||
mpctx->filename);
|
||||
}
|
||||
}
|
||||
mpctx->add_osd_seek_info = 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user