static void Close( vlc_object_t *p_this ) { decoder_t *p_dec = (decoder_t *)p_this; decoder_sys_t *p_sys = p_dec->p_sys; dca_free( p_sys->p_libdca ); free( p_sys ); }
/*********************************************************************** * Close *********************************************************************** * Free memory **********************************************************************/ static void decdcaClose( hb_work_object_t * w ) { hb_work_private_t * pv = w->private_data; dca_free( pv->state ); hb_list_empty( &pv->list ); free( pv ); w->private_data = NULL; }
/***************************************************************************** * CloseFilter : deallocate data structures *****************************************************************************/ static void CloseFilter( vlc_object_t *p_this ) { filter_t *p_filter = (filter_t *)p_this; filter_sys_t *p_sys = p_filter->p_sys; dca_free( p_sys->p_libdca ); free( p_sys ); }
TaudioCodecLibDTS::~TaudioCodecLibDTS() { if (dll) { if (state) { dca_free(state); } delete dll; } }
static gboolean gst_dtsdec_stop (GstAudioDecoder * dec) { GstDtsDec *dts = GST_DTSDEC (dec); GST_DEBUG_OBJECT (dec, "stop"); dts->samples = NULL; if (dts->state) { dca_free (dts->state); dts->state = NULL; } return TRUE; }
int main(int argc, char *argv[]) { dca_state_t *state; (void)argc; (void)argv; state = dca_init(0); if (!state) { return 1; } dca_free(state); return 0; }
static int decdcaBSInfo( hb_work_object_t *w, const hb_buffer_t *b, hb_work_info_t *info ) { int i, flags, rate, bitrate, frame_length; dca_state_t * state = dca_init( 0 ); memset( info, 0, sizeof(*info) ); /* since DCA frames don't line up with MPEG ES frames scan the * entire frame for an DCA sync pattern. */ for ( i = 0; i < b->size - 7; ++i ) { if( dca_syncinfo( state, &b->data[i], &flags, &rate, &bitrate, &frame_length ) ) { break; } } if ( i >= b->size - 7 ) { /* didn't find DCA sync */ dca_free( state ); return 0; } info->name = "DCA"; info->rate = rate; info->rate_base = 1; info->bitrate = bitrate; info->flags = flags; info->samples_per_frame = frame_length; switch( flags & DCA_CHANNEL_MASK ) { /* mono sources */ case DCA_MONO: info->channel_layout = AV_CH_LAYOUT_MONO; break; /* stereo input */ case DCA_CHANNEL: case DCA_STEREO: case DCA_STEREO_SUMDIFF: case DCA_STEREO_TOTAL: info->channel_layout = AV_CH_LAYOUT_STEREO; break; /* Dolby Pro Logic (a.k.a. Dolby Surround), 4.0 channels (matrix-encoded) */ case DCA_DOLBY: info->channel_layout = AV_CH_LAYOUT_STEREO_DOWNMIX; break; /* 3F/2R input */ case DCA_3F2R: info->channel_layout = AV_CH_LAYOUT_5POINT0; break; /* 3F/1R input */ case DCA_3F1R: info->channel_layout = AV_CH_LAYOUT_4POINT0; break; /* other inputs */ case DCA_3F: info->channel_layout = AV_CH_LAYOUT_SURROUND; break; case DCA_2F1R: info->channel_layout = AV_CH_LAYOUT_2_1; break; case DCA_2F2R: info->channel_layout = AV_CH_LAYOUT_2_2; break; case DCA_4F2R: info->channel_layout = AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER; break; /* unknown */ default: info->channel_layout = AV_CH_LAYOUT_STEREO; } if (flags & DCA_LFE) { info->channel_layout |= AV_CH_LOW_FREQUENCY; } info->channel_map = &hb_qt_chan_map; dca_free( state ); return 1; }