[MPlayer-cvslog] r22380 - trunk/stream/stream.c

nicodvb subversion at mplayerhq.hu
Thu Mar 1 00:40:39 CET 2007


Author: nicodvb
Date: Thu Mar  1 00:40:39 2007
New Revision: 22380

Modified:
   trunk/stream/stream.c

Log:
cleaned stream_seek() : simplified the alignment to STREAM_BUFFER_SIZE or s->sector_size

Modified: trunk/stream/stream.c
==============================================================================
--- trunk/stream/stream.c	(original)
+++ trunk/stream/stream.c	Thu Mar  1 00:40:39 2007
@@ -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",



More information about the MPlayer-cvslog mailing list