Postby klchin » 21 Jul 2009 09:59
Hi,
I'm new to VLC and libVLC, i had converted some of the libVLC 1.0.0 header to Delphi 5.
If anyone needs it, please give me your email address.
I was able to open a media and play the video, but it had some problem.
When play the video with below steps many times, so far so good no problem,
1.a) press the "Open" button to pen a dialog - to specify the file, it will auto play
1.b) before or after stop, press "Play" button (without open dialog), it will call stop then play again
or
2.a) press then "Open" button to pen a dialog - to specify the file, it will auto play
2.b) press the "Stop" button to stop
2.c) follow 2.a
But with steps below, it randomly occured, always stuck on "libvlc_media_player_stop"
3.a) press the "Open" button to pen a dialog - to specify the file, it will auto play
3.b) before or after stop, 3.a
Can the experts tell me what wrong with my step/code.
Functions the general code use
hVlcHnd := libvlc_new( 0,@argv,@fVlcError );
DoStop Funcion
if Playing, libvlc_media_player_stop( hMPlayr,@fVlcError );
libvlc_event_attach( hEvents,mi_events[ncnt],vlcCallBack,PVOID(Self),@fVlcError );
libvlc_media_player_release( hMPlayr );
DoPlay Function
libvlc_media_player_set_hwnd( hMPlayr,PVOID(Self.Handle),@fVlcError );
libvlc_media_player_event_manager( hMPlayr,@fVlcError );
libvlc_event_attach( hEvents,mi_events[ncnt],vlcCallBack,PVOID(Self),@fVlcError );
libvlc_media_player_play( hMPlayr,@fVlcError );
libvlc_playlist_play( hVlcHnd,fVlcVideo,0,NIL,@fVlcError );
Play Function
will call DoStop
hVMedia := libvlc_media_new( hVlcHnd,PCHAR(FilePath),@fVlcError );
hMPlayr := libvlc_media_player_new_from_media( hVMedia,@fVlcError );
libvlc_media_release( hVMedia );
will call DoPlay
Reagrds,
KL Chin