summaryrefslogtreecommitdiffstats
path: root/demux/demux.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-06 13:43:01 +0100
committerwm4 <wm4@nowhere>2014-02-06 13:43:01 +0100
commitbc35d4fcb4398e09c7787c1e0b5ce98934c5e89d (patch)
tree50f3c1011f5cbb731e040579d237ddaf9d8464a0 /demux/demux.c
parent39b932042bfbff91006675a8366afe7789c985a1 (diff)
downloadmpv-bc35d4fcb4398e09c7787c1e0b5ce98934c5e89d.tar.bz2
mpv-bc35d4fcb4398e09c7787c1e0b5ce98934c5e89d.tar.xz
demux: fill metadata directly, instead of using wrapper functions
Get rid of demux_info_add[_bstr] and demuxer_add_chapter_info. Make demuxer_add_chapter_info return the chapter index for convenience.
Diffstat (limited to 'demux/demux.c')
-rw-r--r--demux/demux.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 63a1c16690..519391a9d0 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -719,17 +719,6 @@ void mp_tags_clear(struct mp_tags *tags)
talloc_free_children(tags);
}
-int demux_info_add(demuxer_t *demuxer, const char *opt, const char *param)
-{
- return demux_info_add_bstr(demuxer, bstr0(opt), bstr0(param));
-}
-
-int demux_info_add_bstr(demuxer_t *demuxer, struct bstr opt, struct bstr param)
-{
- mp_tags_set_bstr(demuxer->metadata, opt, param);
- return 1;
-}
-
static int demux_info_print(demuxer_t *demuxer)
{
struct mp_tags *info = demuxer->metadata;
@@ -886,19 +875,7 @@ int demuxer_add_chapter(demuxer_t *demuxer, struct bstr name,
};
mp_tags_set_bstr(new.metadata, bstr0("TITLE"), name);
MP_TARRAY_APPEND(demuxer, demuxer->chapters, demuxer->num_chapters, new);
- return 0;
-}
-
-void demuxer_add_chapter_info(struct demuxer *demuxer, uint64_t demuxer_id,
- bstr key, bstr value)
-{
- for (int n = 0; n < demuxer->num_chapters; n++) {
- struct demux_chapter *ch = &demuxer->chapters[n];
- if (ch->demuxer_id == demuxer_id) {
- mp_tags_set_bstr(ch->metadata, key, value);
- return;
- }
- }
+ return demuxer->num_chapters - 1;
}
static void add_stream_chapters(struct demuxer *demuxer)