[MPlayer-users] mplayer win32 issue

Paul-Kenji Cahier pkc at F1-Photo.com
Sat Nov 15 22:43:18 CET 2003


okay
i've managed to make things MUCH faster
i know it's very dirty but:
in mplayer.c:2219

        float min=softsleep?0.021:0.005;
        current_module="sleep_usleep";
        while(time_frame>min){
          if(time_frame<=0.020)
             usec_sleep(0); // sleeps 1 clock tick (10ms)!
          else
             usec_sleep(1000000*(time_frame-0.020));
          time_frame-=GetRelativeTime();
        }
        if(softsleep){
            current_module="sleep_soft";
            if(time_frame<0) mp_msg(MSGT_AVSYNC, MSGL_WARN, "Warning! Softsleep underflow!\n");
            while(time_frame>0) time_frame-=GetRelativeTime(); // burn the CPU
        }






I change that to:

        float min=softsleep?0.021:0.005;
        current_module="sleep_usleep";
        while(time_frame>min){
          if(time_frame<=0.002)
             usec_sleep(0); // sleeps 1 clock tick (10ms)!
          else
             usec_sleep(1000000*(time_frame-0.002));
          time_frame-=GetRelativeTime();
        }
        if(softsleep){
            current_module="sleep_soft";
            if(time_frame<0) mp_msg(MSGT_AVSYNC, MSGL_WARN, "Warning! Softsleep underflow!\n");
            while(time_frame>0) time_frame-=GetRelativeTime(); // burn the CPU
        }



And now it's working using less than 20% cpu average(it was using more
than 55% before) so basicaly i was right thinking it might have to do
with the timer

I dunno how this values should be correctly tweaked, or if i
unwillingly sthing that works, but at least now it's working better
than all other mplayers under win32



More information about the MPlayer-users mailing list