summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_cue.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/demux/demux_cue.c b/demux/demux_cue.c
index 43420573ec..da84fc60c1 100644
--- a/demux/demux_cue.c
+++ b/demux/demux_cue.c
@@ -150,8 +150,18 @@ static void build_timeline(struct timeline *tl)
add_source(tl, tl->demuxer);
- struct cue_track *tracks = p->f->tracks;
- size_t track_count = p->f->num_tracks;
+ struct cue_track *tracks = NULL;
+ size_t track_count = 0;
+
+ for (size_t n = 0; n < p->f->num_tracks; n++) {
+ struct cue_track *track = &p->f->tracks[n];
+ if (track->filename) {
+ MP_TARRAY_APPEND(ctx, tracks, track_count, *track);
+ } else {
+ MP_WARN(tl->demuxer, "No file specified for track entry %zd. "
+ "It will be removed\n", n + 1);
+ }
+ }
if (track_count == 0) {
MP_ERR(tl, "CUE: no tracks found!\n");