Commit Jat's patch for bug 1281

git-svn-id: https://svn.musicpd.org/mpd/trunk@4136 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Qball Cow 2006-05-08 08:14:37 +00:00
parent b016b3bc79
commit 37c9265357
5 changed files with 7 additions and 12 deletions

View File

@ -24,6 +24,7 @@
#include "command.h"
#include "playerData.h"
#include "utils.h"
#include "playlist.h"
#include <stdlib.h>
#include <string.h>
@ -37,7 +38,6 @@
#define AUDIO_DEVICE_STATE "audio_device_state:"
#define AUDIO_DEVICE_STATE_LEN 19 /* strlen(AUDIO_DEVICE_STATE) */
#define AUDIO_BUFFER_SIZE 2*MAXPATHLEN
static void saveAudioDevicesState();
static AudioFormat audio_format;
@ -232,7 +232,6 @@ void finishAudioConfig() {
void finishAudioDriver() {
int i;
saveAudioDevicesState();
for(i = 0; i < audioOutputArraySize; i++) {
finishAudioOutput(audioOutputArray[i]);
}
@ -427,15 +426,7 @@ void printAudioDevices(FILE * fp) {
}
}
static char * getStateFile() {
ConfigParam * param = parseConfigFilePath(CONF_STATE_FILE, 0);
if(!param) return NULL;
return param->value;
}
static void saveAudioDevicesState() {
void saveAudioDevicesState() {
char *stateFile;
FILE *fp;
int i;

View File

@ -77,4 +77,6 @@ void printAudioDevices(FILE * fp);
void readAudioDevicesState();
void saveAudioDevicesState();
#endif

View File

@ -595,6 +595,7 @@ int main(int argc, char * argv[]) {
}
savePlaylistState();
saveAudioDevicesState();
freeAllInterfaces();

View File

@ -92,7 +92,7 @@ static void swapOrder(int a, int b);
static int playPlaylistOrderNumber(FILE * fp, int orderNum);
static void randomizeOrder(int start, int end);
static char * getStateFile() {
char * getStateFile() {
ConfigParam * param = parseConfigFilePath(CONF_STATE_FILE, 0);
if(!param) return NULL;

View File

@ -118,5 +118,6 @@ int playlistChangesPosId(FILE * fp, mpd_uint32 version);
int PlaylistInfo(FILE * fp, char * utf8file, int detail);
char * getStateFile();
#endif