some minor tweaks, and a minor memory leak plugged
git-svn-id: https://svn.musicpd.org/mpd/trunk@2445 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
42e147a1f8
commit
5f219d925c
@ -212,10 +212,7 @@ static int audioOutputAo_play(AudioOutput * audioOutput, char * playChunk,
|
|||||||
int send;
|
int send;
|
||||||
AoData * ad = (AoData *)audioOutput->data;
|
AoData * ad = (AoData *)audioOutput->data;
|
||||||
|
|
||||||
if(ad->device==NULL) {
|
if(ad->device==NULL) return -1;
|
||||||
ERROR("trying to play w/o the ao device being open!\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
while(size>0) {
|
while(size>0) {
|
||||||
send = ad->writeSize > size ? size : ad->writeSize;
|
send = ad->writeSize > size ? size : ad->writeSize;
|
||||||
|
@ -61,7 +61,7 @@ typedef struct _ShoutData {
|
|||||||
AudioFormat inAudioFormat;
|
AudioFormat inAudioFormat;
|
||||||
|
|
||||||
char * convBuffer;
|
char * convBuffer;
|
||||||
long convBufferLen;
|
size_t convBufferLen;
|
||||||
/* shoud we convert the audio to a different format? */
|
/* shoud we convert the audio to a different format? */
|
||||||
int audioFormatConvert;
|
int audioFormatConvert;
|
||||||
|
|
||||||
@ -87,6 +87,7 @@ static ShoutData * newShoutData() {
|
|||||||
static void freeShoutData(ShoutData * sd) {
|
static void freeShoutData(ShoutData * sd) {
|
||||||
if(sd->shoutConn) shout_free(sd->shoutConn);
|
if(sd->shoutConn) shout_free(sd->shoutConn);
|
||||||
if(sd->tag) freeMpdTag(sd->tag);
|
if(sd->tag) freeMpdTag(sd->tag);
|
||||||
|
if(sd->convBuffer) free(sd->convBuffer);
|
||||||
|
|
||||||
free(sd);
|
free(sd);
|
||||||
}
|
}
|
||||||
@ -113,6 +114,10 @@ static int shout_initDriver(AudioOutput * audioOutput, ConfigParam * param) {
|
|||||||
|
|
||||||
sd = newShoutData();
|
sd = newShoutData();
|
||||||
|
|
||||||
|
if(shoutInitCount == 0) shout_init();
|
||||||
|
|
||||||
|
shoutInitCount++;
|
||||||
|
|
||||||
checkBlockParam("host");
|
checkBlockParam("host");
|
||||||
host = blockParam->value;
|
host = blockParam->value;
|
||||||
|
|
||||||
@ -228,10 +233,6 @@ static int shout_initDriver(AudioOutput * audioOutput, ConfigParam * param) {
|
|||||||
|
|
||||||
audioOutput->data = sd;
|
audioOutput->data = sd;
|
||||||
|
|
||||||
if(shoutInitCount == 0) shout_init();
|
|
||||||
|
|
||||||
shoutInitCount++;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -423,7 +424,7 @@ static int shout_openDevice(AudioOutput * audioOutput,
|
|||||||
static void shout_convertAudioFormat(ShoutData * sd, char ** chunkArgPtr,
|
static void shout_convertAudioFormat(ShoutData * sd, char ** chunkArgPtr,
|
||||||
int * sizeArgPtr)
|
int * sizeArgPtr)
|
||||||
{
|
{
|
||||||
int size = pcm_sizeOfOutputBufferForAudioFormatConversion(
|
size_t size = pcm_sizeOfOutputBufferForAudioFormatConversion(
|
||||||
&(sd->inAudioFormat), *sizeArgPtr,
|
&(sd->inAudioFormat), *sizeArgPtr,
|
||||||
&(sd->outAudioFormat));
|
&(sd->outAudioFormat));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user