Discussion:
[libdvdcss-devel] Fix position after partial read in libc_read
Evgeny Grin
2015-01-27 14:40:26 UTC
Permalink
libdvdcss | branch: master | Evgeny Grin <***@kodi.tv> | Tue Jan 27 15:39:10 2015 +0100| [2ce12e9e2b52955c20804845840d2239fe279674] | committer: Jean-Baptiste Kempf

Fix position after partial read in libc_read
http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=2ce12e9e2b52955c20804845840d2239fe279674
---

src/device.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/device.c b/src/device.c
index 77c9821..50fc754 100644
--- a/src/device.c
+++ b/src/device.c
@@ -578,10 +578,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_blocks;
dvdcss->i_pos = -1;
- i_seek = libc_seek( dvdcss, i_ret_blocks );
+ i_seek = libc_seek( dvdcss, i_set_pos );
if( i_seek < 0 )
{
return i_seek;

Loading...