Bug, the property Playing returns incorrect value

This forum is about all development around libVLC.
Monty Mole
New Cone
New Cone
Posts: 3
Joined: 21 Feb 2009 19:37

Bug, the property Playing returns incorrect value

Postby Monty Mole » 22 Feb 2009 14:14

It seems to me that the property Playing returns an incorrect value. This concerns version 0.9.8.1 of plugin V1, I'm sure this has been working in earlier version.

I am using VB.net 2008, Windows Vista SP1.

This is how I done the test:

-VB.net 2008, create new Windows Forms Application project.
-To Form1, add 1 VideoLAN VLC ActiveC Plugin v1, 1 textbox, 5 buttons.
-Add the code below.
-Start the application
-Enter a path/name of a movie file in the text box
-Click Load
-Click Play
-Click "Check if playing", working correct.
-Click Pause
-Click "Check if playing", working correct.
-Click Play
-Click "Check if playing", NOT working correct.
-NOTE CLICK STOP BEFORE CLOSING THE APPLICATION, WINDOWS MIGHT CRASH OTHERWISE.

----------------

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AxVLCPlugin1.playlistClear()
AxVLCPlugin1.addTarget(TextBox1.Text, Nothing, AXVLC.VLCPlaylistMode.VLCPlayListReplace, 0)
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
AxVLCPlugin1.play()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
AxVLCPlugin1.pause()
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
AxVLCPlugin1.stop()
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
MsgBox("Playing: " & AxVLCPlugin1.Playing)
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Button1.Text = "Load file"
Button2.Text = "Play"
Button3.Text = "Pause"
Button4.Text = "Stop"
Button5.Text = "Check if playing"
End Sub
End Class

Rémi Denis-Courmont
Developer
Developer
Posts: 15279
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Bug, the property Playing returns incorrect value

Postby Rémi Denis-Courmont » 22 Feb 2009 15:40

VLC is threaded. The value you get from IsPlaying was correct "a certain small amount of time in the past". There is no way to get the correct value unless you lock the input thread, which requires direct access to libvlccore.dll (and will crash VLC if you gets threading wrong).
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 14 guests