From c3d6f4b63b37994a14099e0e88e8ae87121cb7bf Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 4 Dec 2014 21:06:18 +0100 Subject: dvd, bd: don't unnecessarily block on demuxer/stream all the time This was completely breaking any low-level caching. Change it so that at least demuxer caching will work. Do this by using the metadata cache mechanism to funnel through the menu commands. For some incomprehensible reason, I had to reorder the events (which affects their delivery priority), or they would be ignored. Probably some crap about the event state being cleared before it could be delivered. I don't give a shit. All this code sucks. It would probably be better to let discnav.c access the menu event "queue" directly, and to synchronize access with a mutex, instead of going through all the caching layers, making things complicated and slow. --- player/discnav.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'player') diff --git a/player/discnav.c b/player/discnav.c index 5d477d6313..46049807bf 100644 --- a/player/discnav.c +++ b/player/discnav.c @@ -195,9 +195,12 @@ void mp_handle_nav(struct MPContext *mpctx) struct mp_nav_state *nav = mpctx->nav_state; if (!nav) return; + mpctx->sleeptime = MPMIN(mpctx->sleeptime, 0.5); while (1) { + if (!mpctx->demuxer) + break; struct mp_nav_event *ev = NULL; - run_stream_control(mpctx, STREAM_CTRL_GET_NAV_EVENT, &ev); + demux_control(mpctx->demuxer, DEMUXER_CTRL_GET_NAV_EVENT, &ev); if (!ev) break; switch (ev->event) { -- cgit v1.2.3