From 082371a1603eaaa6c5c9f4bd57f9e77ff027ee15 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 17 Feb 2015 23:49:38 +0100 Subject: demux: remove file_contents field Only demux_cue and demux_edl used it. It's a weird field and doesn't help with anything anymore - by now, it only saves a priv context in the mentioned demuxers. Reducing the number of confusing things the demuxer struct has is more important than minimizing the code. --- demux/demux_cue.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'demux/demux_cue.c') diff --git a/demux/demux_cue.c b/demux/demux_cue.c index 494ca6a78b..969c3ebb84 100644 --- a/demux/demux_cue.c +++ b/demux/demux_cue.c @@ -76,6 +76,10 @@ struct cue_track { struct bstr title; }; +struct priv { + bstr data; +}; + static enum cue_command read_cmd(struct bstr *data, struct bstr *out_params) { struct bstr line = bstr_strip_linebreaks(bstr_getline(*data, data)); @@ -279,11 +283,13 @@ static double source_get_length(struct demuxer *demuxer) static void build_timeline(struct timeline *tl) { + struct priv *p = tl->demuxer->priv; + void *ctx = talloc_new(NULL); add_source(tl, tl->demuxer); - struct bstr data = tl->demuxer->file_contents; + struct bstr data = p->data; data = skip_utf8_bom(data); struct cue_track *tracks = NULL; @@ -425,8 +431,10 @@ static int try_open_file(struct demuxer *demuxer, enum demux_check check) if (d.len < 1 || !mp_probe_cue(d)) return -1; } - demuxer->file_contents = stream_read_complete(s, demuxer, 1000000); - if (demuxer->file_contents.start == NULL) + struct priv *p = talloc_zero(demuxer, struct priv); + demuxer->priv = p; + p->data = stream_read_complete(s, demuxer, 1000000); + if (p->data.start == NULL) return -1; return 0; } -- cgit v1.2.3