void libavsmash_video_free_decode_handler_ptr ( libavsmash_video_decode_handler_t **vdhpp ) { if( !vdhpp || !*vdhpp ) return; libavsmash_video_free_decode_handler( *vdhpp ); *vdhpp = NULL; }
/***************************************************************************** * Allocators / Deallocators *****************************************************************************/ libavsmash_video_decode_handler_t *libavsmash_video_alloc_decode_handler ( void ) { libavsmash_video_decode_handler_t *vdhp = (libavsmash_video_decode_handler_t *)lw_malloc_zero( sizeof(libavsmash_video_decode_handler_t) ); if( !vdhp ) return NULL; vdhp->frame_buffer = av_frame_alloc(); if( !vdhp->frame_buffer ) { libavsmash_video_free_decode_handler( vdhp ); return NULL; } return vdhp; }
/* Deallocate the handler of this plugin. */ static void free_handler ( lsmas_handler_t **hpp ) { if( !hpp || !*hpp ) return; lsmas_handler_t *hp = *hpp; lsmash_root_t *root = libavsmash_video_get_root( hp->vdhp ); lw_free( libavsmash_video_get_preferred_decoder_names( hp->vdhp ) ); libavsmash_video_free_decode_handler( hp->vdhp ); libavsmash_video_free_output_handler( hp->vohp ); avformat_close_input( &hp->format_ctx ); lsmash_close_file( &hp->file_param ); lsmash_destroy_root( root ); lw_free( hp ); }