# HG changeset patch # User reimar # Date 1187602124 0 # Node ID 71d17c28f545ec345acf20a0c0ef9f15524f5174 # Parent 2b572bde6b3d3cd30a2af497bc3d32c5ef829e80 We can support SEEK_END seeks only when stream->end_pos is known diff -r 2b572bde6b3d -r 71d17c28f545 libmpdemux/demux_lavf.c --- a/libmpdemux/demux_lavf.c Mon Aug 20 09:27:47 2007 +0000 +++ b/libmpdemux/demux_lavf.c Mon Aug 20 09:28:44 2007 +0000 @@ -141,7 +141,7 @@ mp_msg(MSGT_HEADER,MSGL_DBG2,"mp_seek(%p, %d, %d)\n", h, (int)pos, whence); if(whence == SEEK_CUR) pos +=stream_tell(stream); - else if(whence == SEEK_END) + else if(whence == SEEK_END && stream->end_pos > 0) pos += stream->end_pos; else if(whence == SEEK_SET) pos += stream->start_pos;