diff options
-rw-r--r-- | DOCS/interface-changes.rst | 1 | ||||
-rw-r--r-- | DOCS/man/input.rst | 5 | ||||
-rw-r--r-- | player/command.c | 14 |
3 files changed, 6 insertions, 14 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 1298c24d6d..377d3efbb0 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -22,6 +22,7 @@ Interface changes --- mpv 0.17.0 --- - deprecate "track-list/N/audio-channels" property (use "track-list/N/demux-channel-count" instead) + - remove write access to "stream-pos", and change semantics for read access --- mpv 0.16.0 --- - change --audio-channels default to stereo (use --audio-channels=auto to get the old default) diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index 0cdb611583..8aafadbf81 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -921,8 +921,9 @@ Property list useless. It looks like this can be different from ``path`` only when using e.g. ordered chapters.) -``stream-pos`` (RW) - Raw byte position in source stream. +``stream-pos`` + Raw byte position in source stream. Technically, this returns the position + of the most recent packet passed to a decoder. ``stream-end`` Raw end position in bytes in source stream. diff --git a/player/command.c b/player/command.c index 42938af140..fe2eb3eb22 100644 --- a/player/command.c +++ b/player/command.c @@ -458,24 +458,14 @@ static int mp_property_file_format(void *ctx, struct m_property *prop, return m_property_strdup_ro(action, arg, name); } -/// Position in the stream (RW) static int mp_property_stream_pos(void *ctx, struct m_property *prop, int action, void *arg) { MPContext *mpctx = ctx; struct demuxer *demuxer = mpctx->demuxer; - if (!demuxer) + if (!demuxer || demuxer->filepos < 0) return M_PROPERTY_UNAVAILABLE; - demux_pause(demuxer); - int r; - if (action == M_PROPERTY_SET) { - stream_seek(demuxer->stream, *(int64_t *) arg); - r = M_PROPERTY_OK; - } else { - r = m_property_int64_ro(action, arg, stream_tell(demuxer->stream)); - } - demux_unpause(demuxer); - return r; + return m_property_int64_ro(action, arg, demuxer->filepos); } /// Stream end offset (RO) |