Skip to content

Commit

Permalink
pmusic: bugfix: high cpu-usage on first run
Browse files Browse the repository at this point in the history
high cpu-usage on first run if no internet connection (thanks to norgo)
http://www.murga-linux.com/puppy/viewtopic.php?p=876894#876894
  • Loading branch information
zigbert committed Dec 16, 2015
1 parent c4e3c04 commit 678f3de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions woof-code/rootfs-packages/pmusic/usr/local/pmusic/pmusic
Expand Up @@ -9,7 +9,7 @@
#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. <http://www.gnu.org/licenses/>.
#------------------------------

VERSION="4.7.3" #REMEMBER to set version in $APPDIR/pmusicrc
VERSION="4.7.4" #REMEMBER to set version in $APPDIR/pmusicrc
export AUDIO_FORMATS="\.aac$|\.ac3$|\.aif$|\.aiff$|\.ape$|\.asf$|\.au$|\.flac$|\.gsm$|\.kar$|\.m4a$|\.mid$|\.mp1$|\.mp2$|\.mp3$|\.mp4$|\.mpc$|\.ogg$|\.ra$|\.raw$|\.shn$|\.voc$|\.wav$|\.wma$|\.wv$"
type pequalizer > /dev/null 2>&1 && pequalizer -s & #setup initial presets
export GTKDIALOG=gtkdialog
Expand Down Expand Up @@ -136,6 +136,7 @@ if [ "$FIRST_RUN" = "true" ] || [ "$VERSION_UPGRADE" = "true" ]; then
LANG=C wget --spider --tries 1 $PING_SERVER 2> $WORKDIR/tmp #check connection
if [ "`grep 'connected' $WORKDIR/tmp`" ]; then
echo -e '|05:52|Hoovers - Let me be there in the morning|http://api.jamendo.com/get2/stream/track/redirect/?streamencoding=mp31&id=859743|00001 http://api.jamendo.com/get2/stream/track/redirect/?streamencoding=mp31&id=859743' > $WORKDIR/playlist
FIRSTRUN_CONNECTION=true
fi
#Puppy...
#add mime type
Expand Down Expand Up @@ -425,7 +426,7 @@ for I in `grep -i pmusic $WORKDIR/tmp | grep -E "gtkdialog|update_index|func_pro
! grep aplay $WORKDIR/tmp > /dev/null && rm -f $WORKDIR/ffmpeg_output

#more first_run - this will only run if gui shows up. It might be that first run is with parameters like --version.
if [ "$FIRST_RUN" = "true" ] || [ "$VERSION_UPGRADE" = "true" ] && [ "$RUN_CD" != "true" ] && [ ! -s $WORKDIR/AUTOPLAY ]; then #do not run this if -c switch is used
if [ "$FIRST_RUN" = "true" ] || [ "$VERSION_UPGRADE" = "true" ] && [ "$FIRSTRUN_CONNECTION" = "true" ] && [ "$RUN_CD" != "true" ] && [ ! -s $WORKDIR/AUTOPLAY ]; then #do not run this if -c switch is used
echo true > $WORKDIR/AUTOPLAY #lock this
$APPDIR/func_player -play -skip_update &
fi
Expand Down

0 comments on commit 678f3de

Please sign in to comment.