From df8b99490ca15f0d55681a30bea8e81dd529ea12 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 30 Apr 2014 11:46:40 +0200 Subject: demux: add hack to get initial ICY info to be printed Newly added metadata (such as the ICY title, sent some seconds after opening the stream) simply wasn't printed. This problem doesn't exist in git master. Fixes #753. --- demux/demux.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'demux/demux.c') diff --git a/demux/demux.c b/demux/demux.c index e38b0f0c1d..7e0fbac058 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -522,6 +522,7 @@ static struct demuxer *open_given_type(struct mpv_global *global, .glog = log, .filename = talloc_strdup(demuxer, stream->url), .metadata = talloc_zero(demuxer, struct mp_tags), + .initializing = true, }; demuxer->params = params; // temporary during open() stream_seek(stream, stream->start_pos); @@ -554,6 +555,7 @@ static struct demuxer *open_given_type(struct mpv_global *global, "File is not seekable, but there's a cache: enabling seeking.\n"); demuxer->seekable = true; } + demuxer->initializing = false; return demuxer; } @@ -724,6 +726,8 @@ int demux_info_add_bstr(demuxer_t *demuxer, struct bstr opt, struct bstr param) if (oldval) { if (bstrcmp0(param, oldval) == 0) return 0; + } + if (!demuxer->initializing) { MP_INFO(demuxer, "Demuxer info %.*s changed to %.*s\n", BSTR_P(opt), BSTR_P(param)); } @@ -740,6 +744,8 @@ int demux_info_print(demuxer_t *demuxer) if (!info || !info->num_keys) return 0; + demux_info_update(demuxer); + mp_info(demuxer->glog, "Clip info:\n"); for (n = 0; n < info->num_keys; n++) { mp_info(demuxer->glog, " %s: %s\n", info->keys[n], info->values[n]); -- cgit v1.2.3