From 3f3ffd0de4943a1ce8e5dd1fbf457bcba989fc2b Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 2 Jul 2013 12:18:04 +0200 Subject: core: update metadata during playback, allow streams to export metadata STREAM_CTRL_GET_METADATA will be used to poll for streamcast metadata. Also add DEMUXER_CTRL_UPDATE_INFO, which could in theory be used by demux_lavf.c. (Unfortunately, libavformat is too crappy to read metadata mid-stream for mp3 or ogg, so we don't implement it.) --- core/mp_core.h | 1 + core/mplayer.c | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'core') diff --git a/core/mp_core.h b/core/mp_core.h index 08f84dd817..600c56c4d6 100644 --- a/core/mp_core.h +++ b/core/mp_core.h @@ -226,6 +226,7 @@ typedef struct MPContext { double audio_delay; double last_heartbeat; + double last_metadata_update; double mouse_timer; unsigned int mouse_event_ts; diff --git a/core/mplayer.c b/core/mplayer.c index b564048560..28d120f636 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -3643,6 +3643,11 @@ static void run_playloop(struct MPContext *mpctx) mp_input_get_cmd(mpctx->input, sleeptime * 1000, true); } + if (mp_time_sec() > mpctx->last_metadata_update + 2) { + demux_info_update(mpctx->demuxer); + mpctx->last_metadata_update = mp_time_sec(); + } + //================= Keyboard events, SEEKing ==================== handle_pause_on_low_cache(mpctx); -- cgit v1.2.3