int mm_close(mm_file *mf) { assert(mf); if (mf->file) { fclose(mf->file); mf->file = NULL; } if (mf->audio) { ogg_stream_destroy(mf->audio); mf->audio = NULL; } if (mf->video) { ogg_stream_destroy(mf->video); mf->video = NULL; } if (mf->video_ctx) { theora_clear(mf->video_ctx); free(mf->video_ctx); mf->video_ctx = NULL; } if (mf->video_info) { theora_info_clear(mf->video_info); free(mf->video_info); mf->video_info = NULL; } if (mf->audio_blk) { vorbis_block_clear(mf->audio_blk); free(mf->audio_blk); mf->audio_blk = NULL; } if (mf->audio_ctx) { vorbis_dsp_clear(mf->audio_ctx); free(mf->audio_ctx); mf->audio_ctx = NULL; } if (mf->audio_info) { vorbis_info_clear(mf->audio_info); free(mf->audio_info); mf->audio_info = NULL; } ogg_sync_clear(&mf->sync); return 0; }
static PyObject * py_ogg_ogg_stream_destroy(PyObject *self, PyObject *args) { int c_out; int size; ogg_stream_state * os; PyArg_ParseTuple(args, "s#", &os, &size); c_out = ogg_stream_destroy(os); return Py_BuildValue("i", c_out); };
static void FreeStream(ogg* p,oggstream* Stream) { vorbis_comment_clear(&Stream->Comment); vorbis_info_clear(&Stream->Info); ogg_packet_release(&Stream->OggPacket); if (Stream->OggStream) { ogg_stream_destroy(Stream->OggStream); Stream->OggStream = NULL; } }
/* * Class: org_tritonus_lowlevel_ogg_StreamState * Method: destroy * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_tritonus_lowlevel_ogg_StreamState_destroy (JNIEnv* env, jobject obj) { ogg_stream_state* handle; int nReturn; if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_ogg_StreamState_destroy(): begin\n"); } handle = getHandle(env, obj); nReturn = ogg_stream_destroy(handle); if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_ogg_StreamState_destroy(): end\n"); } return nReturn; }