[MPlayer-users] [patch] fix 2GiB problem with wav file playback

dean gaudet dean at arctic.org
Mon Apr 24 00:19:51 CEST 2006


the first chunk of this patch eliminates problems with playing/seeking 
past the 2GiB mark of wav files (int/off_t mixup)... to reproduce it just 
play a >2GiB wav file and skip forward until you cross the 2GiB mark and 
it'll jump back to time 0.

the second chunk seems like it's a bug waiting to happen, but i didn't 
directly diagnose anything related to it.

thanks
-dean

diff -ru mplayer-1.0-pre7cvs20060416.pre/libmpdemux/demux_audio.c mplayer-1.0-pre7cvs20060416/libmpdemux/demux_audio.c
--- mplayer-1.0-pre7cvs20060416.pre/libmpdemux/demux_audio.c	2006-04-16 00:09:44.000000000 -0700
+++ mplayer-1.0-pre7cvs20060416/libmpdemux/demux_audio.c	2006-04-23 14:49:21.525074629 -0700
@@ -649,7 +649,7 @@
 static void demux_audio_seek(demuxer_t *demuxer,float rel_seek_secs,float audio_delay,int flags){
   sh_audio_t* sh_audio;
   stream_t* s;
-  int base,pos;
+  off_t base,pos;
   float len;
   da_priv_t* priv;
 
diff -ru mplayer-1.0-pre7cvs20060416.pre/libmpdemux/stream.h mplayer-1.0-pre7cvs20060416/libmpdemux/stream.h
--- mplayer-1.0-pre7cvs20060416.pre/libmpdemux/stream.h	2006-04-16 00:09:44.000000000 -0700
+++ mplayer-1.0-pre7cvs20060416/libmpdemux/stream.h	2006-04-23 14:22:59.804563449 -0700
@@ -89,8 +89,8 @@
   int type; // see STREAMTYPE_*
   int flags;
   int sector_size; // sector size (seek will be aligned on this size if non 0)
-  unsigned int buf_pos,buf_len;
-  off_t pos,start_pos,end_pos;
+  unsigned int buf_len;
+  off_t pos,start_pos,end_pos,buf_pos;
   int eof;
   unsigned int cache_pid;
   void* cache_data;




More information about the MPlayer-users mailing list