diff options
Diffstat (limited to 'audio')
-rw-r--r-- | audio/alsaaudio.c | 12 | ||||
-rw-r--r-- | audio/audio_template.h | 15 | ||||
-rw-r--r-- | audio/ossaudio.c | 6 |
3 files changed, 10 insertions, 23 deletions
diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index e4e5442631..74ead97d87 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -815,10 +815,8 @@ static void alsa_fini_out (HWVoiceOut *hw) ldebug ("alsa_fini\n"); alsa_anal_close (&alsa->handle, &alsa->pollhlp); - if (alsa->pcm_buf) { - g_free (alsa->pcm_buf); - alsa->pcm_buf = NULL; - } + g_free(alsa->pcm_buf); + alsa->pcm_buf = NULL; } static int alsa_init_out (HWVoiceOut *hw, struct audsettings *as) @@ -978,10 +976,8 @@ static void alsa_fini_in (HWVoiceIn *hw) alsa_anal_close (&alsa->handle, &alsa->pollhlp); - if (alsa->pcm_buf) { - g_free (alsa->pcm_buf); - alsa->pcm_buf = NULL; - } + g_free(alsa->pcm_buf); + alsa->pcm_buf = NULL; } static int alsa_run_in (HWVoiceIn *hw) diff --git a/audio/audio_template.h b/audio/audio_template.h index 16f7880770..817318853c 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -71,10 +71,7 @@ static void glue (audio_init_nb_voices_, TYPE) (struct audio_driver *drv) static void glue (audio_pcm_hw_free_resources_, TYPE) (HW *hw) { - if (HWBUF) { - g_free (HWBUF); - } - + g_free (HWBUF); HWBUF = NULL; } @@ -92,9 +89,7 @@ static int glue (audio_pcm_hw_alloc_resources_, TYPE) (HW *hw) static void glue (audio_pcm_sw_free_resources_, TYPE) (SW *sw) { - if (sw->buf) { - g_free (sw->buf); - } + g_free (sw->buf); if (sw->rate) { st_rate_stop (sw->rate); @@ -172,10 +167,8 @@ static int glue (audio_pcm_sw_init_, TYPE) ( static void glue (audio_pcm_sw_fini_, TYPE) (SW *sw) { glue (audio_pcm_sw_free_resources_, TYPE) (sw); - if (sw->name) { - g_free (sw->name); - sw->name = NULL; - } + g_free (sw->name); + sw->name = NULL; } static void glue (audio_pcm_hw_add_sw_, TYPE) (HW *hw, SW *sw) diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 5a73716032..4db2ca65bf 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -736,10 +736,8 @@ static void oss_fini_in (HWVoiceIn *hw) oss_anal_close (&oss->fd); - if (oss->pcm_buf) { - g_free (oss->pcm_buf); - oss->pcm_buf = NULL; - } + g_free(oss->pcm_buf); + oss->pcm_buf = NULL; } static int oss_run_in (HWVoiceIn *hw) |