diff options
author | Karlson2k <k2k@narod.ru> | 2014-11-12 16:32:45 +0300 |
---|---|---|
committer | Karlson2k <k2k@narod.ru> | 2014-11-12 16:33:04 +0300 |
commit | 74089ce08a5b6a99bf19275187b9fb0375d819c7 (patch) | |
tree | 3a5f730ea72ff53c1086605e4bc7a439459312d2 /lib/libdvd | |
parent | 6004c447cb14bbf95fa71d1f2c10247652996d59 (diff) |
libdvdcss: fix position after partial read in libc_read
Diffstat (limited to 'lib/libdvd')
-rw-r--r-- | lib/libdvd/libdvdcss/src/device.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libdvd/libdvdcss/src/device.c b/lib/libdvd/libdvdcss/src/device.c index 2395ab512c..3de18793be 100644 --- a/lib/libdvd/libdvdcss/src/device.c +++ b/lib/libdvd/libdvdcss/src/device.c @@ -828,10 +828,11 @@ static int libc_read ( dvdcss_t dvdcss, void *p_buffer, int i_blocks ) /* Handle partial reads */ if( i_ret != i_size ) { - int i_seek; + int i_seek, i_set_pos; + i_set_pos = dvdcss->i_pos + i_ret / DVDCSS_BLOCK_SIZE; dvdcss->i_pos = -1; - i_seek = libc_seek( dvdcss, i_ret / DVDCSS_BLOCK_SIZE ); + i_seek = libc_seek( dvdcss, i_set_pos ); if( i_seek < 0 ) { return i_seek; |