Coverage Report

Created: 2026-03-12 07:20

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/mpv/demux/timeline.c
Line
Count
Source
1
#include "common/common.h"
2
#include "stream/stream.h"
3
#include "demux.h"
4
5
#include "timeline.h"
6
7
struct timeline *timeline_load(struct mpv_global *global, struct mp_log *log,
8
                               struct demuxer *demuxer)
9
131k
{
10
131k
    if (!demuxer->desc->load_timeline)
11
107k
        return NULL;
12
13
24.2k
    struct timeline *tl = talloc_ptrtype(NULL, tl);
14
24.2k
    *tl = (struct timeline){
15
24.2k
        .global = global,
16
24.2k
        .log = log,
17
24.2k
        .cancel = demuxer->cancel,
18
24.2k
        .demuxer = demuxer,
19
24.2k
        .format = "unknown",
20
24.2k
        .stream_origin = demuxer->stream_origin,
21
24.2k
    };
22
23
24.2k
    demuxer->desc->load_timeline(tl);
24
25
24.2k
    if (tl->num_pars)
26
12.1k
        return tl;
27
12.1k
    timeline_destroy(tl);
28
12.1k
    return NULL;
29
24.2k
}
30
31
void timeline_destroy(struct timeline *tl)
32
24.2k
{
33
24.2k
    if (!tl)
34
0
        return;
35
38.8k
    for (int n = 0; n < tl->num_sources; n++) {
36
14.6k
        struct demuxer *d = tl->sources[n];
37
14.6k
        if (d != tl->demuxer)
38
14.3k
            demux_free(d);
39
14.6k
    }
40
24.2k
    talloc_free(tl);
41
24.2k
}