diff options
author | michael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2017-12-29 08:54:48 +0000 |
---|---|---|
committer | michael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2017-12-29 08:54:48 +0000 |
commit | 9f82b9e8dd683c04d263421e2b5f2eda054f1ca2 (patch) | |
tree | 31c39e5733e9d747952367a69d42fd002e7bee10 /packages/libvlc | |
parent | 0dfe20b5570719fd260b1797e84ecd6d2dd6fe12 (diff) | |
download | fpc-9f82b9e8dd683c04d263421e2b5f2eda054f1ca2.tar.gz |
* Fix bug 30838 (AV in some cases)
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@37848 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/libvlc')
-rwxr-xr-x | packages/libvlc/src/vlc.pp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/libvlc/src/vlc.pp b/packages/libvlc/src/vlc.pp index 346e5feab7..2a9bf6a606 100755 --- a/packages/libvlc/src/vlc.pp +++ b/packages/libvlc/src/vlc.pp @@ -473,7 +473,10 @@ end; function TCustomVLCMediaListPlayer.GetPlaying: Boolean; begin - Result:=libvlc_media_list_player_is_playing(Instance)<>0; + if Assigned(FPlayer) then + Result:=libvlc_media_list_player_is_playing(Instance)<>0 + else + Result:=false; end; function TCustomVLCMediaListPlayer.GetInstance: plibvlc_media_list_player_t; @@ -495,7 +498,10 @@ end; function TCustomVLCMediaListPlayer.GetState: libvlc_state_t; begin - Result:=libvlc_media_list_player_get_state(Instance) + if Assigned(FInstance) then + Result:=libvlc_media_list_player_get_state(Instance) + else + Result:=libvlc_NothingSpecial; end; function TCustomVLCMediaListPlayer.GetVLC: TVLCLibrary; @@ -527,6 +533,7 @@ begin end; procedure TCustomVLCMediaListPlayer.SetPlayMode(AValue: TVLCPlayMode); + Const M : Array [TVLCPlayMode] of libvlc_playback_mode_t = (libvlc_playback_mode_default, @@ -534,6 +541,7 @@ Const libvlc_playback_mode_repeat); begin + if not Assigned(Finstance) then Exit; if FPlayMode=AValue then Exit; FPlayMode:=AValue; libvlc_media_list_player_set_playback_mode(FInstance, M[AValue]); |