Try to remove the link between libvlc and the display surface before calling dispose.I have been using the VideoLan Interop on VLC 1.0.0,1.0.1 and now 1.0.2...
When trying to .DISPOSE on the PLAYER object, AFTER it has ended, the hangds in the COM layer.
This occurs as in the Dispose method of the player, it calls .STOP, no matter the current state.
Code: Select all
VideoLan.VideoLanClient client = new VideoLan.VideoLanClient(@"E:\VLC\");
VideoLan.VlcMedia video = client.NewMedia(file_path);
VideoLan.VlcMediaPlayer tmp = client.NewMediaPlayer(pnl_video.Handle,video);
tmp.Play();
I don't use this wrapper, but this works for me.[...]
i use vlc-1.0.2 for C# wrapper.
and use libvlc_media_player_set_hwnd to set the parent of the video.
but it create a new window titled "hardware YUV overlay DirectX output"
[...]
so do anyone know what's the problem?
Code: Select all
libvlc_media_player_set_drawable(this.vlc_mi, this.vlc_window.Handle, ref vlc_e);
set_drawable is the same result。I don't use this wrapper, but this works for me.[...]
i use vlc-1.0.2 for C# wrapper.
and use libvlc_media_player_set_hwnd to set the parent of the video.
but it create a new window titled "hardware YUV overlay DirectX output"
[...]
so do anyone know what's the problem?vlc_window is just a plain System.Windows.FormCode: Select all
libvlc_media_player_set_drawable(this.vlc_mi, this.vlc_window.Handle, ref vlc_e);
Code: Select all
VideoLan.VideoLanClient Vlc;
VideoLan.VlcMediaPlayer VlcPlayer;
Vlc = new VideoLanClient();
VlcPlayer = Vlc.NewMediaPlayer(pnlVideo.Handle);
private void Play()
{
VlcMedia desc = Vlc.NewMedia(@"C:\MovieWithAudiosAndSubtitles.ts");
desc.AddOption(":udp-caching=1000");
desc.AddOption(":clock-synchro=1");
desc.AddOption(":video-filter=adjust:deinterlace");
desc.AddOption(":deinterlace-mode=discard");
desc.AddOption(":codec=ffmpeg,none");
desc.AddOption(":drop-late-frames");
desc.AddOption(":high-priority");
desc.AddOption(":no-video-title-show");
VlcPlayer.Load(desc);
desc.Dispose();
VlcPlayer.Play();
}
private void btnSetAudioAndSubtitle_Click(object sender, EventArgs e)
{
// Changed language to English
VlcPlayer.Audio.Track = 2; // Set audio to 2, english works
try
{
VlcTrack track = VlcPlayer.Subtitles[7706]; // 7706 = Key id of the subtitle
VlcPlayer.Subtitles.Current = track; // This will throw exception, but why? It found the track, but will not set it.
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Code: Select all
namespace VideoLan
{
public abstract class VlcTracks : IEnumerable<VlcTrack>
{
public VlcTrack Current
{
get
{
if (_ReloadTracks) LoadTracks();
lock (Player.player_lock)
{
int rtn = GetTrackCurrentInternal();
Player.p_ex.CheckException();
return _Tracks[rtn];
}
}
set
{
if (_ReloadTracks) LoadTracks();
lock (Player.player_lock)
{
if (_Tracks.ContainsKey(value.ID))
{
SetTrackCurrentInternal(value.ID);
Player.p_ex.CheckException();
}
}
}
}
Return to “Development around libVLC”
Users browsing this forum: No registered users and 9 guests