mirror of
https://github.com/mpv-player/mpv
synced 2025-01-03 05:22:23 +00:00
demux_timeline: cosmetics: move a function
Gets rid of a forward declaration.
This commit is contained in:
parent
3c3cd0c540
commit
ce0b99314b
@ -25,8 +25,6 @@
|
|||||||
#include "timeline.h"
|
#include "timeline.h"
|
||||||
#include "stheader.h"
|
#include "stheader.h"
|
||||||
|
|
||||||
static void reselect_streams(struct demuxer *demuxer);
|
|
||||||
|
|
||||||
struct segment {
|
struct segment {
|
||||||
int index;
|
int index;
|
||||||
double start, end;
|
double start, end;
|
||||||
@ -69,6 +67,30 @@ struct priv {
|
|||||||
double seek_pts;
|
double seek_pts;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void reselect_streams(struct demuxer *demuxer)
|
||||||
|
{
|
||||||
|
struct priv *p = demuxer->priv;
|
||||||
|
|
||||||
|
for (int n = 0; n < p->num_streams; n++) {
|
||||||
|
struct virtual_stream *vs = &p->streams[n];
|
||||||
|
vs->selected = demux_stream_is_selected(vs->sh);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int n = 0; n < p->num_segments; n++) {
|
||||||
|
struct segment *seg = p->segments[n];
|
||||||
|
for (int i = 0; i < seg->num_stream_map; i++) {
|
||||||
|
struct sh_stream *sh = demux_get_stream(seg->d, i);
|
||||||
|
bool selected = false;
|
||||||
|
if (seg->stream_map[i] >= 0)
|
||||||
|
selected = p->streams[seg->stream_map[i]].selected;
|
||||||
|
// This stops demuxer readahead for inactive segments.
|
||||||
|
if (!p->current || seg->d != p->current->d)
|
||||||
|
selected = false;
|
||||||
|
demuxer_select_track(seg->d, sh, selected);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void switch_segment(struct demuxer *demuxer, struct segment *new,
|
static void switch_segment(struct demuxer *demuxer, struct segment *new,
|
||||||
double start_pts, int flags)
|
double start_pts, int flags)
|
||||||
{
|
{
|
||||||
@ -349,30 +371,6 @@ static void d_close(struct demuxer *demuxer)
|
|||||||
free_demuxer(master);
|
free_demuxer(master);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reselect_streams(struct demuxer *demuxer)
|
|
||||||
{
|
|
||||||
struct priv *p = demuxer->priv;
|
|
||||||
|
|
||||||
for (int n = 0; n < p->num_streams; n++) {
|
|
||||||
struct virtual_stream *vs = &p->streams[n];
|
|
||||||
vs->selected = demux_stream_is_selected(vs->sh);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int n = 0; n < p->num_segments; n++) {
|
|
||||||
struct segment *seg = p->segments[n];
|
|
||||||
for (int i = 0; i < seg->num_stream_map; i++) {
|
|
||||||
struct sh_stream *sh = demux_get_stream(seg->d, i);
|
|
||||||
bool selected = false;
|
|
||||||
if (seg->stream_map[i] >= 0)
|
|
||||||
selected = p->streams[seg->stream_map[i]].selected;
|
|
||||||
// This stops demuxer readahead for inactive segments.
|
|
||||||
if (!p->current || seg->d != p->current->d)
|
|
||||||
selected = false;
|
|
||||||
demuxer_select_track(seg->d, sh, selected);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int d_control(struct demuxer *demuxer, int cmd, void *arg)
|
static int d_control(struct demuxer *demuxer, int cmd, void *arg)
|
||||||
{
|
{
|
||||||
struct priv *p = demuxer->priv;
|
struct priv *p = demuxer->priv;
|
||||||
|
Loading…
Reference in New Issue
Block a user