aboutsummaryrefslogtreecommitdiffhomepage
path: root/stream
diff options
context:
space:
mode:
authorGravatar nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-02-28 23:40:39 +0000
committerGravatar nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-02-28 23:40:39 +0000
commit667e45974a3a3f779ebf9fb2bda444780a06a9fa (patch)
tree250c60839683e1295b1577f97e3e409146e29993 /stream
parentb8da7b60a870d218d1aec9a1a012dddef77f703a (diff)
cleaned stream_seek() : simplified the alignment to STREAM_BUFFER_SIZE or s->sector_size
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22380 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/stream.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/stream/stream.c b/stream/stream.c
index 2a8338ddb9..cd63a37170 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -299,26 +299,10 @@ off_t newpos=0;
return 1;
}
- switch(s->type){
- case STREAMTYPE_STREAM:
-#ifdef _LARGEFILE_SOURCE
- newpos=pos&(~((long long)STREAM_BUFFER_SIZE-1));break;
-#else
- newpos=pos&(~(STREAM_BUFFER_SIZE-1));break;
-#endif
- default:
- // Round on sector size
- if(s->sector_size)
- newpos=(pos/s->sector_size)*s->sector_size;
- else { // Otherwise on the buffer size
-#ifdef _LARGEFILE_SOURCE
- newpos=pos&(~((long long)STREAM_BUFFER_SIZE-1));break;
-#else
- newpos=pos&(~(STREAM_BUFFER_SIZE-1));break;
-#endif
- }
- break;
- }
+ if(s->sector_size)
+ newpos = (pos/s->sector_size)*s->sector_size;
+ else
+ newpos = pos&(~((off_t)STREAM_BUFFER_SIZE-1));
if( mp_msg_test(MSGT_STREAM,MSGL_DBG3) ){
mp_msg(MSGT_STREAM,MSGL_DBG3, "s->pos=%"PRIX64" newpos=%"PRIX64" new_bufpos=%"PRIX64" buflen=%X \n",