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.
This commit is contained in:
wm4
2014-04-30 11:46:40 +02:00
parent c78142a973
commit df8b99490c
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -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]);
+1
View File
@@ -170,6 +170,7 @@ typedef struct demuxer {
// File format allows PTS resets (even if the current file is without)
bool ts_resets_possible;
bool warned_queue_overflow;
bool initializing;
struct sh_stream **streams;
int num_streams;