void theora_encoder_clear (CP_INSTANCE * cpi){ if(cpi){ ClearHuffmanSet(&cpi->pb); ClearFragmentInfo(&cpi->pb); ClearFrameInfo(&cpi->pb); EClearFragmentInfo(cpi); EClearFrameInfo(cpi); ClearTmpBuffers(&cpi->pb); ClearPPInstance(&cpi->pp); oggpackB_writeclear(cpi->oggbuffer); _ogg_free(cpi->oggbuffer); _ogg_free(cpi); } }
static void theora_encode_clear (theora_state *th){ CP_INSTANCE *cpi; cpi=(CP_INSTANCE *)th->internal_encode; if(cpi){ ClearHuffmanSet(&cpi->pb); ClearFragmentInfo(&cpi->pb); ClearFrameInfo(&cpi->pb); EClearFragmentInfo(cpi); EClearFrameInfo(cpi); ClearTmpBuffers(&cpi->pb); ClearPPInstance(&cpi->pp); oggpackB_writeclear(cpi->oggbuffer); _ogg_free(cpi->oggbuffer); _ogg_free(cpi); } memset(th,0,sizeof(*th)); }