1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 00:42:57 +00:00

demux: move a function

The new location makes equally much sense (or more, since it's close to
its per-stream companion function), and we don't need a forward
declaration.
This commit is contained in:
wm4 2019-06-13 19:34:20 +02:00
parent 95c97cd66e
commit e320f02187

View File

@ -416,8 +416,6 @@ static void add_packet_locked(struct sh_stream *stream, demux_packet_t *dp);
static struct demux_packet *advance_reader_head(struct demux_stream *ds);
static bool queue_seek(struct demux_internal *in, double seek_pts, int flags,
bool clear_back_state);
static void clear_reader_state(struct demux_internal *in,
bool clear_back_state);
static uint64_t get_foward_buffered_bytes(struct demux_stream *ds)
{
@ -801,6 +799,18 @@ static void ds_clear_reader_state(struct demux_stream *ds,
}
}
// called locked, from user thread only
static void clear_reader_state(struct demux_internal *in,
bool clear_back_state)
{
for (int n = 0; n < in->num_streams; n++)
ds_clear_reader_state(in->streams[n]->ds, clear_back_state);
in->warned_queue_overflow = false;
in->d_user->filepos = -1; // implicitly synchronized
in->blocked = false;
in->need_back_seek = false;
}
// Call if the observed reader state on this stream somehow changes. The wakeup
// is skipped if the reader successfully read a packet, because that means we
// expect it to come back and ask for more.
@ -3175,18 +3185,6 @@ struct demuxer *demux_open_url(const char *url,
return d;
}
// called locked, from user thread only
static void clear_reader_state(struct demux_internal *in,
bool clear_back_state)
{
for (int n = 0; n < in->num_streams; n++)
ds_clear_reader_state(in->streams[n]->ds, clear_back_state);
in->warned_queue_overflow = false;
in->d_user->filepos = -1; // implicitly synchronized
in->blocked = false;
in->need_back_seek = false;
}
// clear the packet queues
void demux_flush(demuxer_t *demuxer)
{