Vlccontrol.media使我的程序在一段时间后停滞不前 [英] Vlccontrol.media make my program stuck after some time

查看:494
本文介绍了Vlccontrol.media使我的程序在一段时间后停滞不前的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



我在vb.net上写一个程序

在我的程序中我需要在某个文件夹中播放这些视频将一个接一个地出现。

为了做到这一点,我使用vlc版本1.1.1.1与vlcControl对象

,一切正常,但几个小时后程序是卡住了 - 它没有回复



它被卡住的行是:

Hello

I am writing a program in vb.net
In my program I need to do that videos in a certain folder will appear one after the other.
In order to do that i am using vlc version 1.1.1.1 with vlcControl object
, everything work fine but after some hours the program is stuck-it is not responding

The line where it is stuck is :

MoviOfSlidePicMovi1.Media = VlcMedia





为了解决这个问题,我尝试通过这些句子释放内存:



In order to solve it I tried to release the memory via these Sentences:

 Public MoviOfSlidePicMovi1 As VlcControl
Public VlcMedia As Vlc.DotNet.Core.Medias.PathMedia
 If (MoviOfSlidePicMovi0.Media IsNot Nothing) Then
   MoviOfSlidePicMovi0.Media.Dispose()
  MoviOfSlidePicMovi0.Media = Nothing
 End If
  If (VlcMedia IsNot Nothing) Then
      VlcMedia.Dispose()
       VlcMedia = Nothing
 End If
  VlcMedia = New Vlc.DotNet.Core.Medias.PathMedia(str)
  MoviOfSlidePicMovi0.Media = VlcMedia





如果它不起作用,我在没有处理句子的情况下尝试相同的句子:





when it didn't worked, I tried the same sentences without the dispose sentence:

 Public MoviOfSlidePicMovi1 As VlcControl
Public VlcMedia As Vlc.DotNet.Core.Medias.PathMedia
 If (MoviOfSlidePicMovi0.Media IsNot Nothing) Then
  MoviOfSlidePicMovi0.Media = Nothing
 End If
  If (VlcMedia IsNot Nothing) Then
       VlcMedia = Nothing
 End If
  VlcMedia = New Vlc.DotNet.Core.Medias.PathMedia(str)
  MoviOfSlidePicMovi0.Media = VlcMedia





程序运行得更好,但是几个小时后它仍然停滞了



注意:

我使用相同的对象来显示所有视频 - 这意味着我正在使用一个vlc播放器,我打开一个视频,当我想要替换它时,我只更改媒体属性



我怎样才能让它无故障地工作一段时间之后该程序会被卡住???



请帮我这件事非常紧急



非常感谢



我尝试过:



我试图释放内存 - 就像我在问题正文中写的那样

但它没有解决我的问题



the program worked better ,but still after few hours it was stuck

NOTE:
I am using the same object to show all the videos-it mean I am using one vlc player ,I open one video and when I want to replace it I am changing just the media property

How can I make it work without causing the program to be stuck after some time ???

Please help me it very urgent to me

thanks a lot

What I have tried:

I tried to release the memory- in the way that I wrote in the body of the question
but it didn't solve my problem

推荐答案

你应该在不同的线程上运行这样的东西,然后你的应用程序不会挂起。

确保你处理不再使用的实例。

同时尝试清理%TEMP%文件夹。
You should run such stuff on a different Thread, then your App wont hang.
Make sure you dispose the instances that are not used anymore.
Also try to clean the %TEMP% folder.


这篇关于Vlccontrol.media使我的程序在一段时间后停滞不前的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆