summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
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;