summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-12-22 01:56:25 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2017-12-23 00:32:59 +0100
commit2c3a172ef12d142c994e8b5e7ff04875b7076841 (patch)
treeabc0fe5c507d7b096ef90cfe7f53912d3ccb20f9
parent62cf960ef0a6050e8718197320ab47ce037cee8e (diff)
downloadmpv-2c3a172ef12d142c994e8b5e7ff04875b7076841.tar.bz2
mpv-2c3a172ef12d142c994e8b5e7ff04875b7076841.tar.xz
demux: note refresh state separately in debug output
This log line tells us why the demuxer is trying to read more, which us useful when debugging queue overflows. Probably barely useful, but I think keeping that flag separately also makes the code slightly easier to understand.
-rw-r--r--demux/demux.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 311c6704f9..a52ca0fbfd 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -1217,18 +1217,18 @@ static bool read_packet(struct demux_internal *in)
// Check if we need to read a new packet. We do this if all queues are below
// the minimum, or if a stream explicitly needs new packets. Also includes
// safe-guards against packet queue overflow.
- bool read_more = false, prefetch_more = false;
+ bool read_more = false, prefetch_more = false, refresh_more = false;
for (int n = 0; n < in->num_streams; n++) {
struct demux_stream *ds = in->streams[n]->ds;
read_more |= ds->eager && !ds->reader_head;
- prefetch_more |= ds->refreshing;
+ refresh_more |= ds->refreshing;
if (ds->eager && ds->queue->last_ts != MP_NOPTS_VALUE &&
in->min_secs > 0 && ds->base_ts != MP_NOPTS_VALUE &&
ds->queue->last_ts >= ds->base_ts)
prefetch_more |= ds->queue->last_ts - ds->base_ts < in->min_secs;
}
- MP_TRACE(in, "bytes=%zd, read_more=%d prefetch_more=%d\n",
- in->fw_bytes, read_more, prefetch_more);
+ MP_TRACE(in, "bytes=%zd, read_more=%d prefetch_more=%d, refresh_more=%d\n",
+ in->fw_bytes, read_more, prefetch_more, refresh_more);
if (in->fw_bytes >= in->max_bytes) {
// if we hit the limit just by prefetching, simply stop prefetching
if (!read_more)
@@ -1260,7 +1260,7 @@ static bool read_packet(struct demux_internal *in)
return false;
}
- if (!read_more && !prefetch_more)
+ if (!read_more && !prefetch_more && !refresh_more)
return false;
// Actually read a packet. Drop the lock while doing so, because waiting