diff options
author | wm4 <wm4@nowhere> | 2019-06-13 19:34:20 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-09-19 20:37:05 +0200 |
commit | e320f02187a19e62b5bb48d4fd7cf5625dbee83c (patch) | |
tree | 64bac94b15f3ab3da287c289c572e4cfff20c322 | |
parent | 95c97cd66e2fd2e79565d1ef563a19ad6d96b071 (diff) | |
download | mpv-e320f02187a19e62b5bb48d4fd7cf5625dbee83c.tar.bz2 mpv-e320f02187a19e62b5bb48d4fd7cf5625dbee83c.tar.xz |
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.
-rw-r--r-- | demux/demux.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/demux/demux.c b/demux/demux.c index 5c7cfcbd55..11b89a7b37 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -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) { |