VLC use alot of CPU during paused state
When playing a downloaded copy of http://vimeo.com/104935950 Xorg takes 28.5% CPU, vlc takes another 50.7% CPU (This is on a 2.2 GHz CPU, and I can reproduce a similar scenario on a 1.8 GHz machine).
Quote from top:
1438715 tange 20 0 1825688 118476 48396 S 50.7 0.4 1:41.23 vlc
3678 root 20 0 1503564 879144 178560 R 28.5 2.7 2175:25 Xorg
That is not a big problem. The big problem comes in paused state. Here Xorg takes 19.2% and vlc 16.0%:
3678 root 20 0 1503564 879144 178560 S 19.2 2.7 2175:42 Xorg
1438715 tange 20 0 1825688 125888 48396 S 16.0 0.4 2:02.61 vlc
If I stop the video Xorg drops to 9.5% and vlc to 0%. If I quit vlc Xorg stays around 10%.
I would have expected 'pause' take as much CPU power as 'stop', and 'resume' to take as much CPU power as 'play'+'seek'.
Why is it more CPU efficient to manually 'stop', and then later press 'play' and manually 'seek' to the position where you left off, than it is to press 'pause'/'resume'?
Would it make sense to implement 'pause' as:
Record time stamp Take screenshot of current frame Tear down everything as if the user had pressed 'stop' Show a still photo of the screenshot (not using the video out plugins) If possible: Ask the window manager to deal with damage Go to sleep
And 'resume' as:
Start playing as if the user had pressed 'play' Seek to the time stamp recorded earlier as if the user had seeked to that position Continue playing from there
I understand that in paused state, VLC may still have to deal with OSD, but I will happily trade OSD away in paused state if I can save 25% CPU power.
I also understand that by doing the 'stop'/'play'+'seek' it may take a bit longer to 'resume' as the system will have to decode the frames before the 'resume' frame. Again I feel that is a tiny price to pay for 25% CPU power.