VideoSource::~VideoSource() { // media list and media list player libvlc_media_list_player_stop(mediaListPlayer); libvlc_media_list_player_release(mediaListPlayer); libvlc_media_list_release(mediaList); // media player libvlc_video_set_callbacks(mediaPlayer, nullptr, nullptr, nullptr, nullptr); libvlc_media_player_stop(mediaPlayer); delete audioOutputStreamHandler; audioOutputStreamHandler = nullptr; libvlc_media_player_release(mediaPlayer); if (pixelData) { free(pixelData); pixelData = nullptr; } if (texture) { delete texture; texture = nullptr; } delete config; config = nullptr; DeleteCriticalSection(&textureLock); }
VlcMediaListPlayer::~VlcMediaListPlayer() { removeCoreConnections(); libvlc_media_list_player_release(_vlcMediaListPlayer); VlcError::errmsg(); }
static void releaseMediaPlayer(JNIEnv *env, jobject thiz) { libvlc_media_list_player_t* p_mlp = getMediaListPlayer(env, thiz); if (p_mlp) { libvlc_media_list_player_stop(p_mlp); libvlc_media_list_player_release(p_mlp); /* libvlc_media_list_player_release frees the media player, so * we don't free it ourselves. */ setLong(env, thiz, "mInternalMediaPlayerInstance", 0); setLong(env, thiz, "mMediaListPlayerInstance", 0); } }
void VideoPlayer::closePlayer() { #ifdef HAS_LIBVLC if(ctxPtr != NULL && ctxPtr->libvlc != NULL) { // // Stop stream and clean up libVLC // #if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_0) libvlc_media_player_stop(ctxPtr->mp,&ex); catchError(&ex); #else libvlc_media_player_stop(ctxPtr->mp); #endif if(ctxPtr->mlp != NULL) { libvlc_media_list_player_release(ctxPtr->mlp); ctxPtr->mlp = NULL; } libvlc_media_player_release(ctxPtr->mp); ctxPtr->mp = NULL; libvlc_release(ctxPtr->libvlc); } #endif // // Close window and clean up libSDL // if(ctxPtr != NULL) { if(ctxPtr->mutex != NULL) { SDL_DestroyMutex(ctxPtr->mutex); } if(ctxPtr->surf != NULL) { SDL_FreeSurface(ctxPtr->surf); } if(ctxPtr->empty != NULL) { SDL_FreeSurface(ctxPtr->empty); } glDeleteTextures(1, &ctxPtr->textureId); if(ctxPtr->needToQuit == true) { SDL_Event quit_event = {SDL_QUIT}; SDL_PushEvent(&quit_event); } } }
static PP_Bool remove_instance(instance_t* instance) { assert(instance != NULL); assert(g_instances != NULL && g_instances->count > 0); const size_t new_bytes = sizeof(instance_t) * (g_instances->count - 1); instances_t* new_instances = malloc(new_bytes + sizeof(instances_t)); CHECKMALLOC("malloc new_instances", new_instances, PP_FALSE); new_instances->count = g_instances->count - 1; instance_t* cur_array = get_instances_array(g_instances); instance_t* new_array = get_instances_array(new_instances); if(new_instances->count != 0) { const size_t slice_start = (size_t)(instance - cur_array); const size_t slice_end = slice_start + 1; memmove(new_array, cur_array, (size_t)(instance - cur_array)); memmove((uint8_t*)new_array + slice_start, (uint8_t*)cur_array + slice_end, new_bytes - slice_end); } instances_t* old_instances = g_instances; g_instances = new_instances; if(instance->vlc != NULL) { libvlc_release(instance->vlc); } if(instance->media_player != NULL) { libvlc_media_player_release(instance->media_player); } if(instance->media_list_player != NULL) { libvlc_media_list_player_release(instance->media_list_player); } if(instance->playlist != NULL) { libvlc_media_list_release(instance->playlist); } free(old_instances); return PP_OK; }
void VLC::release(libvlc_media_list_player_t *mediaListPlayer) { libvlc_media_list_player_release(mediaListPlayer); }
RadioPlayer::~RadioPlayer() { removeCoreConnections(); libvlc_media_list_player_release(_mediaListPlayer); libvlc_release(_instance); qDebug() << "RadioPlayer: Destroyed."; }