diff options
author | wm4 <wm4@nowhere> | 2015-02-14 15:13:58 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-14 15:13:58 +0100 |
commit | 04472352aedb88884fa4dc9be5ab37ef3980e87d (patch) | |
tree | ecc18d1c04e1feb1bc6a7ce5897d68e6fb509f91 | |
parent | a799a4c57f998ed2ef7f5d306d4dad32c173c349 (diff) | |
download | mpv-04472352aedb88884fa4dc9be5ab37ef3980e87d.tar.bz2 mpv-04472352aedb88884fa4dc9be5ab37ef3980e87d.tar.xz |
player: fix audio-device-list updates
The way the AO wakes up the playloop has nothing to do with events;
instead we must query the events on the AO once the playloop was woken
up. Querying the events in every playloop iteration is thus the correct
way to do this.
-rw-r--r-- | player/command.c | 5 | ||||
-rw-r--r-- | player/command.h | 2 | ||||
-rw-r--r-- | player/playloop.c | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c index b8a0a7b5ce..9378f53df0 100644 --- a/player/command.c +++ b/player/command.c @@ -4875,6 +4875,11 @@ static void command_event(struct MPContext *mpctx, int event, void *arg) // Update chapters - does nothing if something else is visible. set_osd_bar_chapters(mpctx, OSD_BAR_SEEK); } +} + +void handle_command_updates(struct MPContext *mpctx) +{ + struct command_ctx *ctx = mpctx->command_ctx; // This is a bit messy: ao_hotplug wakes up the player, and then we have // to recheck the state. Then the client(s) will read the property. diff --git a/player/command.h b/player/command.h index 945d686786..2e5bdfe546 100644 --- a/player/command.h +++ b/player/command.h @@ -36,6 +36,8 @@ int mp_property_do(const char* name, int action, void* val, void mp_notify(struct MPContext *mpctx, int event, void *arg); void mp_notify_property(struct MPContext *mpctx, const char *property); +void handle_command_updates(struct MPContext *mpctx); + int mp_get_property_id(const char *name); uint64_t mp_get_property_event_mask(const char *name); diff --git a/player/playloop.c b/player/playloop.c index defc6ba6f3..9471664e10 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -986,6 +986,7 @@ void run_playloop(struct MPContext *mpctx) handle_cursor_autohide(mpctx); handle_vo_events(mpctx); handle_heartbeat_cmd(mpctx); + handle_command_updates(mpctx); fill_audio_out_buffers(mpctx, endpts); write_video(mpctx, endpts); |