summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-07 16:05:27 +0100
committerwm4 <wm4@nowhere>2019-11-07 22:53:13 +0100
commit19becc8ea911e74b5443420a8da411444f980725 (patch)
tree988baf142ea3ed3bd2dcea51bece2ca94ab2fa7d /stream
parent6487abde79684ace6e24a127d1f62febf40f0d9b (diff)
downloadmpv-19becc8ea911e74b5443420a8da411444f980725.tar.bz2
mpv-19becc8ea911e74b5443420a8da411444f980725.tar.xz
stats, demux: log byte level stream seeks
Diffstat (limited to 'stream')
-rw-r--r--stream/stream.c2
-rw-r--r--stream/stream.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/stream/stream.c b/stream/stream.c
index 31a4f8fb24..7fd6700cdd 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -634,6 +634,8 @@ static bool stream_seek_unbuffered(stream_t *s, int64_t newpos)
MP_VERBOSE(s, "stream level seek from %" PRId64 " to %" PRId64 "\n",
s->pos, newpos);
+ s->total_stream_seeks++;
+
if (newpos > s->pos && !s->seekable) {
MP_ERR(s, "Cannot seek forward in this stream\n");
return false;
diff --git a/stream/stream.h b/stream/stream.h
index 8b36d137a7..4a38d28109 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -144,6 +144,8 @@ typedef struct stream {
// Read statistic for fill_buffer calls. All bytes read by fill_buffer() are
// added to this. The user can reset this as needed.
uint64_t total_unbuffered_read_bytes;
+ // Seek statistics. The user can reset this as needed.
+ uint64_t total_stream_seeks;
// Buffer size requested by user; s->buffer may have a different size
int requested_buffer_size;