static int init_audio_codec(struct dec_audio *d_audio, const char *decoder) { if (!d_audio->ad_driver->init(d_audio, decoder)) { MP_VERBOSE(d_audio, "Audio decoder init failed.\n"); d_audio->ad_driver = NULL; uninit_decoder(d_audio); return 0; } d_audio->decode_buffer = mp_audio_buffer_create(NULL); if (!reinit_audio_buffer(d_audio)) { uninit_decoder(d_audio); return 0; } return 1; }
void audio_uninit(struct dec_audio *d_audio) { if (!d_audio) return; if (d_audio->afilter) { mp_msg(MSGT_DECAUDIO, MSGL_V, "Uninit audio filters...\n"); af_destroy(d_audio->afilter); d_audio->afilter = NULL; } uninit_decoder(d_audio); talloc_free(d_audio->decode_buffer); talloc_free(d_audio); }
void audio_uninit(struct dec_audio *d_audio) { if (!d_audio) return; if (d_audio->afilter) { MP_VERBOSE(d_audio, "Uninit audio filters...\n"); af_destroy(d_audio->afilter); d_audio->afilter = NULL; } uninit_decoder(d_audio); talloc_free(d_audio->decode_buffer); talloc_free(d_audio); }
static int init_audio_codec(struct dec_audio *d_audio, const char *decoder) { if (!d_audio->ad_driver->init(d_audio, decoder)) { mp_tmsg(MSGT_DECAUDIO, MSGL_V, "Audio decoder init failed.\n"); d_audio->ad_driver = NULL; uninit_decoder(d_audio); return 0; } if (!d_audio->decoded.channels.num || !d_audio->decoded.rate || !d_audio->decoded.format) { mp_tmsg(MSGT_DECAUDIO, MSGL_ERR, "Audio decoder did not specify " "audio format!\n"); uninit_decoder(d_audio); return 0; } d_audio->decode_buffer = mp_audio_buffer_create(NULL); reinit_audio_buffer(d_audio); return 1; }