void lwlibav_audio_free_decode_handler_ptr ( lwlibav_audio_decode_handler_t **adhpp ) { if( !adhpp || !*adhpp ) return; lwlibav_audio_free_decode_handler( *adhpp ); *adhpp = NULL; }
/***************************************************************************** * Allocators / Deallocators *****************************************************************************/ lwlibav_audio_decode_handler_t *lwlibav_audio_alloc_decode_handler ( void ) { lwlibav_audio_decode_handler_t *adhp = (lwlibav_audio_decode_handler_t *)lw_malloc_zero( sizeof(lwlibav_audio_decode_handler_t) ); if( !adhp ) return NULL; adhp->frame_buffer = av_frame_alloc(); if( !adhp->frame_buffer ) { lwlibav_audio_free_decode_handler( adhp ); return NULL; } return adhp; }
/* Deallocate the handler of this plugin. */ static void free_handler ( lwlibav_handler_t **hpp ) { if( !hpp || !*hpp ) return; lwlibav_handler_t *hp = *hpp; lw_free( lwlibav_video_get_preferred_decoder_names( hp->vdhp ) ); lwlibav_video_free_decode_handler( hp->vdhp ); lwlibav_video_free_output_handler( hp->vohp ); lwlibav_audio_free_decode_handler( hp->adhp ); lwlibav_audio_free_output_handler( hp->aohp ); lw_free( hp->lwh.file_path ); lw_free( hp ); }