[vlc-devel] commit: Allow reading until the end of the file while discarding data. ( Laurent Aimar )
git version control
git at videolan.org
Tue May 5 23:53:52 CEST 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue May 5 23:21:58 2009 +0200| [77c069c68936f12116a504b13d58257da7595542] | committer: Laurent Aimar
Allow reading until the end of the file while discarding data.
It probably closes #2719.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=77c069c68936f12116a504b13d58257da7595542
---
src/input/stream.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/src/input/stream.c b/src/input/stream.c
index 286af64..23276e3 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -1061,7 +1061,16 @@ static int AStreamReadStream( stream_t *s, void *p_read, unsigned int i_read )
bool b_aseek;
access_Control( p_access, ACCESS_CAN_SEEK, &b_aseek );
if( b_aseek )
- return AStreamSeekStream( s, p_sys->i_pos + i_read ) ? 0 : i_read;
+ {
+ const int64_t i_pos_wanted = p_sys->i_pos + i_read;
+
+ if( AStreamSeekStream( s, i_pos_wanted ) )
+ {
+ if( p_sys->i_pos != i_pos_wanted )
+ return 0;
+ }
+ return i_read;
+ }
}
#ifdef STREAM_DEBUG
More information about the vlc-devel
mailing list