summaryrefslogtreecommitdiffstats
path: root/demux/demux.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-04-16 22:23:08 +0200
committerJan Ekström <jeebjp@gmail.com>2018-04-18 01:17:42 +0300
commite7e06a47a0b5626c3abe81f3627d10ed58d92d3b (patch)
tree96384e5dca32219b722aa5f717a716be1010c32e /demux/demux.h
parent020730da0bcc467afee8ff9861fcc9116372003b (diff)
downloadmpv-e7e06a47a0b5626c3abe81f3627d10ed58d92d3b.tar.bz2
mpv-e7e06a47a0b5626c3abe81f3627d10ed58d92d3b.tar.xz
demux: support for some kinds of timed metadata
This makes ICY title changes show up at approximately the correct time, even if the demuxer buffer is huge. (It'll still be wrong if the stream byte cache contains a meaningful amount of data.) It should have the same effect for mid-stream metadata changes in e.g. OGG (untested). This is still somewhat fishy, but in parts due to ICY being fishy, and FFmpeg's metadata change API being somewhat fishy. For example, what happens if you seek? With FFmpeg AVFMT_EVENT_FLAG_METADATA_UPDATED and AVSTREAM_EVENT_FLAG_METADATA_UPDATED we hope that FFmpeg will correctly restore the correct metadata when the first packet is returned. If you seke with ICY, we're out of luck, and some audio will be associated with the wrong tag until we get a new title through ICY metadata update at an essentially random point (it's mostly inherent to ICY). Then the tags will switch back and forth, and this behavior will stick with the data stored in the demuxer cache. Fortunately, this can happen only if the HTTP stream is actually seekable, which it usually is not for ICY things. Seeking doesn't even make sense with ICY, since you can't know the exact metadata location. Basically ICY metsdata sucks. Some complexity is due to a microoptimization: I didn't want additional atomic accesses for each packet if no timed metadata is used. (It probably doesn't matter at all.)
Diffstat (limited to 'demux/demux.h')
-rw-r--r--demux/demux.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/demux/demux.h b/demux/demux.h
index b3088db8c4..0150ce1a1a 100644
--- a/demux/demux.h
+++ b/demux/demux.h
@@ -303,7 +303,7 @@ void demux_set_stream_tags(struct demuxer *demuxer, struct sh_stream *sh,
int demux_stream_control(demuxer_t *demuxer, int ctrl, void *arg);
-void demux_changed(demuxer_t *demuxer, int events);
+void demux_metadata_changed(demuxer_t *demuxer);
void demux_update(demuxer_t *demuxer);
void demux_disable_cache(demuxer_t *demuxer);
@@ -318,4 +318,7 @@ bool demux_matroska_uid_cmp(struct matroska_segment_uid *a,
const char *stream_type_name(enum stream_type type);
+void mp_packet_tags_unref(struct mp_packet_tags *tags);
+void mp_packet_tags_setref(struct mp_packet_tags **dst, struct mp_packet_tags *src);
+
#endif /* MPLAYER_DEMUXER_H */