#!/bin/sh

# "VLC Performance Booster"
# For EeePC users, by Rafael Rigues (rigues@gmail.com)

# Detects current CPU mode and sets it to "performance" before running VLC,
# so the video won't skip, returning to "ondemand" afterwards.

# This is a quick hack, I make no guarantees. Improvements are welcome
# This is only need if you have enabled  processor scaling as per the
# instructions on: http://tinyurl.com/5za4eh

# Instalation instructions
# 1. rename /usr/bin/vlc to /usr/bin/vlc.bin
# 2. copy the script to /usr/bin/vlc
# 3. make it executable with chmod +x /usr/bin/vlc
# 4. give root privileges to cpufreq-set: sudo chmod +s /usr/bin/cpufreq-set

# Changelog
# 20080608 - Initial release

if [ "`cpufreq-info -p | grep -i ondemand`" != "" ]
then
	cpufreq-set -g performance
	/usr/bin/vlc.bin "$@"
	cpufreq-set -g ondemand
else
	/usr/bin/vlc.bin "$@"
fi

