diff options
author | wm4 <wm4@nowhere> | 2014-05-24 14:03:07 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-05-24 16:17:50 +0200 |
commit | e3c20bf3505679641f247471603ad298d04036bd (patch) | |
tree | 72926a284ecd34a3d1be9de8db8d5af0ed45eba8 /demux/demux_lavf.c | |
parent | 3316cf5f9b213dc047aa0515fbc51f12fb27cc58 (diff) | |
download | mpv-e3c20bf3505679641f247471603ad298d04036bd.tar.bz2 mpv-e3c20bf3505679641f247471603ad298d04036bd.tar.xz |
stream: kill start_pos, remove --sb option
stream.start_pos was needed for optical media only, and (apparently) not
for very good reasons. Just get rid of it.
For stream_dvd, we don't need to do anything. Byte seeking was already
removed from it earlier.
For stream_cdda and stream_vcd, emulate the start_pos by offsetting the
stream pos as seen by the rest of mpv.
The bits in discnav.c and loadfile.c were for dealing with the code
seeking back to the start in demux.c. Handle this differently by
assuming the demuxer is always initialized with the stream at start
position, and instead seek back if initializing the demuxer fails.
Remove the --sb option, which worked by modifying stream.start_pos. If
someone really wants this option, it could be added back by creating a
"slice" stream (actually ffmpeg already has such a thing).
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r-- | demux/demux_lavf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index d493e9f631..b5a6ef998c 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -140,10 +140,10 @@ static int64_t mp_seek(void *opaque, int64_t pos, int whence) else if (whence == SEEK_END && stream->end_pos > 0) pos += stream->end_pos; else if (whence == SEEK_SET) - pos += stream->start_pos; + /* ok */; else if (whence == AVSEEK_SIZE && stream->end_pos > 0) { stream_update_size(stream); - return stream->end_pos - stream->start_pos; + return stream->end_pos; } else return -1; @@ -155,7 +155,7 @@ static int64_t mp_seek(void *opaque, int64_t pos, int whence) return -1; } - return pos - stream->start_pos; + return pos; } static int64_t mp_read_seek(void *opaque, int stream_idx, int64_t ts, int flags) @@ -828,7 +828,7 @@ static void demux_seek_lavf(demuxer_t *demuxer, float rel_seek_secs, int flags) !(priv->avif->flags & AVFMT_NO_BYTE_SEEK)) { avsflags |= AVSEEK_FLAG_BYTE; - priv->last_pts = (s->end_pos - s->start_pos) * rel_seek_secs; + priv->last_pts = s->end_pos * rel_seek_secs; } else if (priv->avfc->duration != 0 && priv->avfc->duration != AV_NOPTS_VALUE) { |