close audio device on pause, after we say we have paused, makes pause seem
more responsive git-svn-id: https://svn.musicpd.org/mpd/trunk@504 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
7c861b334b
commit
12d19cccd2
@ -180,10 +180,7 @@ void decodeSeek(PlayerControl * pc, AudioFormat * af, DecoderControl * dc,
|
|||||||
} \
|
} \
|
||||||
if(pc->pause) { \
|
if(pc->pause) { \
|
||||||
pause = !pause; \
|
pause = !pause; \
|
||||||
if(pause) { \
|
if(pause) pc->state = PLAYER_STATE_PAUSE; \
|
||||||
finishAudio(); \
|
|
||||||
pc->state = PLAYER_STATE_PAUSE; \
|
|
||||||
} \
|
|
||||||
else { \
|
else { \
|
||||||
if(initAudio(NULL)<0) { \
|
if(initAudio(NULL)<0) { \
|
||||||
strncpy(pc->erroredFile,pc->file,MAXPATHLEN); \
|
strncpy(pc->erroredFile,pc->file,MAXPATHLEN); \
|
||||||
@ -195,6 +192,7 @@ void decodeSeek(PlayerControl * pc, AudioFormat * af, DecoderControl * dc,
|
|||||||
} \
|
} \
|
||||||
pc->pause = 0; \
|
pc->pause = 0; \
|
||||||
kill(getppid(),SIGUSR1); \
|
kill(getppid(),SIGUSR1); \
|
||||||
|
if(pause) finishAudio(); \
|
||||||
} \
|
} \
|
||||||
if(pc->seek) { \
|
if(pc->seek) { \
|
||||||
pc->totalPlayTime+= pc->elapsedTime-pc->beginTime; \
|
pc->totalPlayTime+= pc->elapsedTime-pc->beginTime; \
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
#include "directory.h"
|
#include "directory.h"
|
||||||
#include "stats.h"
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
@ -642,13 +641,11 @@ int stopPlaylist(FILE * fp) {
|
|||||||
playlist.queued = -1;
|
playlist.queued = -1;
|
||||||
playlist_state = PLAYLIST_STATE_STOP;
|
playlist_state = PLAYLIST_STATE_STOP;
|
||||||
playlist_noGoToNext = 0;
|
playlist_noGoToNext = 0;
|
||||||
/*stats.playTime+=getPlayerElapsedTime();*/
|
|
||||||
if(playlist.random) randomizeOrder(0,playlist.length-1);
|
if(playlist.random) randomizeOrder(0,playlist.length-1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int playPlaylistOrderNumber(FILE * fp, int orderNum) {
|
int playPlaylistOrderNumber(FILE * fp, int orderNum) {
|
||||||
/*stats.songsPlayed++;*/
|
|
||||||
|
|
||||||
if(playerStop(fp)<0) return -1;
|
if(playerStop(fp)<0) return -1;
|
||||||
|
|
||||||
@ -743,11 +740,9 @@ int nextSongInPlaylist(FILE * fp) {
|
|||||||
playlist_stopOnError = 0;
|
playlist_stopOnError = 0;
|
||||||
|
|
||||||
if(playlist.current<playlist.length-1) {
|
if(playlist.current<playlist.length-1) {
|
||||||
/*stats.playTime+=getPlayerElapsedTime();*/
|
|
||||||
return playPlaylistOrderNumber(fp,playlist.current+1);
|
return playPlaylistOrderNumber(fp,playlist.current+1);
|
||||||
}
|
}
|
||||||
else if(playlist.length && playlist.repeat) {
|
else if(playlist.length && playlist.repeat) {
|
||||||
/*stats.playTime+=getPlayerElapsedTime();*/
|
|
||||||
if(playlist.random) randomizeOrder(0,playlist.length-1);
|
if(playlist.random) randomizeOrder(0,playlist.length-1);
|
||||||
return playPlaylistOrderNumber(fp,0);
|
return playPlaylistOrderNumber(fp,0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user