summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_lavf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux/demux_lavf.c')
-rw-r--r--libmpdemux/demux_lavf.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index 02eff0d4b8..5fb66adb9d 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -109,9 +109,12 @@ static int64_t mp_seek(void *opaque, int64_t pos, int whence)
pos += stream->end_pos;
else if (whence == SEEK_SET)
pos += stream->start_pos;
- else if (whence == AVSEEK_SIZE && stream->end_pos > 0)
+ else if (whence == AVSEEK_SIZE && stream->end_pos > 0) {
+ off_t size;
+ if (stream_control(stream, STREAM_CTRL_GET_SIZE, &size) == STREAM_OK)
+ return size;
return stream->end_pos - stream->start_pos;
- else
+ } else
return -1;
if (pos < 0)