diff options
author | ranma <ranma@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-03-14 17:19:19 +0000 |
---|---|---|
committer | ranma <ranma@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-03-14 17:19:19 +0000 |
commit | d5d89cca6a1cca4290ac157fc706337831232d2d (patch) | |
tree | c8a58c92088ff36f2d1f567b95197f5daea14113 | |
parent | 7085181caa28ffe5a7514b18b1971fe16b80f2d2 (diff) |
Fix small memleak in control().
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9584 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libao2/ao_nas.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/libao2/ao_nas.c b/libao2/ao_nas.c index a558d74e50..8ef716ea44 100644 --- a/libao2/ao_nas.c +++ b/libao2/ao_nas.c @@ -339,6 +339,8 @@ static int control(int cmd, int arg) AuFixedPoint fpgain; AuStatus as; int gain; + int retval = CONTROL_UNKNOWN; + ao_control_vol_t *vol = (ao_control_vol_t *)arg; dattr = AuGetDeviceAttributes(nas_data->aud, nas_data->dev, &as); @@ -356,7 +358,9 @@ static int control(int cmd, int arg) vol->right = (float) gain; vol->left = vol->right; - return CONTROL_OK; + mp_msg(MSGT_AO, MSGL_DBG2, "ao_nas: AOCONTROL_GET_VOLUME: %d\n", gain); + retval = CONTROL_OK; + break; case AOCONTROL_SET_VOLUME: /* @@ -365,6 +369,7 @@ static int control(int cmd, int arg) * so i take the mean of both values. */ gain = (int) ((vol->left+vol->right)/2); + mp_msg(MSGT_AO, MSGL_DBG2, "ao_nas: AOCONTROL_SET_VOLUME: %d\n", gain); fpgain = AuFixedPointFromSum(gain, 0); AuDeviceGain(dattr) = fpgain; @@ -373,13 +378,13 @@ static int control(int cmd, int arg) if (as != AuSuccess) { nas_print_error(nas_data->aud, "control(): AuSetDeviceAttributes", as); - return CONTROL_ERROR; - } - return CONTROL_OK; - - default: - return CONTROL_UNKNOWN; + retval = CONTROL_ERROR; + } else retval = CONTROL_OK; + break; }; + + AuFreeDeviceAttributes(nas_data->aud, 1, dattr); + return retval; } // open & setup audio device |