static int get_audio_track( lsmash_handler_t *h, audio_option_t *opt ) { avs_handler_t *hp = (avs_handler_t *)h->audio_private; if( hp->vi->num_audio_samples <= 0 ) return -1; return prepare_audio_decoding( h, opt ); }
LSMASHAudioSource::LSMASHAudioSource ( const char *source, uint32_t track_number, bool skip_priming, uint64_t channel_layout, int sample_rate, IScriptEnvironment *env ) { memset( &vi, 0, sizeof(VideoInfo) ); memset( &adh, 0, sizeof(libavsmash_audio_decode_handler_t) ); memset( &aoh, 0, sizeof(libavsmash_audio_output_handler_t) ); format_ctx = NULL; get_audio_track( source, track_number, skip_priming, env ); lsmash_discard_boxes( adh.root ); prepare_audio_decoding( channel_layout, sample_rate, env ); }