void SoftVorbis::onPortFlushCompleted(OMX_U32 portIndex) {
    if (portIndex == 0 && mState != NULL) {
        // Make sure that the next buffer output does not still
        // depend on fragments from the last one decoded.

        mNumFramesOutput = 0;
        vorbis_dsp_restart(mState);
    }
}
Exemple #2
0
vorbis_dsp_state *vorbis_dsp_create(vorbis_info *vi){
  int i;

  vorbis_dsp_state *v=_ogg_calloc(1,sizeof(*v));
  codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;

  v->vi=vi;
  
  v->work=(ogg_int32_t **)_ogg_malloc(vi->channels*sizeof(*v->work));
  v->mdctright=(ogg_int32_t **)_ogg_malloc(vi->channels*sizeof(*v->mdctright));
  for(i=0;i<vi->channels;i++){
    v->work[i]=(ogg_int32_t *)_ogg_calloc(1,(ci->blocksizes[1]>>1)*
					  sizeof(*v->work[i]));
    v->mdctright[i]=(ogg_int32_t *)_ogg_calloc(1,(ci->blocksizes[1]>>2)*
					       sizeof(*v->mdctright[i]));
  }

  v->lW=0; /* previous window size */
  v->W=0;  /* current window size */

  vorbis_dsp_restart(v);
  return v;
}