start the video at a specific time

This forum is about all development around libVLC.
sokrakes
New Cone
New Cone
Posts: 7
Joined: 21 Jan 2023 00:18

start the video at a specific time

Postby sokrakes » 21 Jan 2023 00:33

Hi,
I'm using the Delphi code shown here - https://wiki.videolan.org/Using_libvlc_with_Delphi, it works fine.
However, I can't seem to add there to run the video at a specific time.
It is

Code: Select all

libvlc_media_player_set_time(libvlc_media_player, 10000);
I searched for a while for the settings, declension, when I managed to run it a message pops up.

Code: Select all

Access violation at address 65E85B78 in module Ílibvlccore,dll. Read of address 00000044
.
Do you have a tip please, point me to working code, for Delphi X5, I'm running on Windows.

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

Re: start the video at a specific time

Postby Rémi Denis-Courmont » 22 Jan 2023 15:48

This is a NULL pointer dereference, and that's pretty much all that can be inferred from the very little info provided.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

sokrakes
New Cone
New Cone
Posts: 7
Joined: 21 Jan 2023 00:18

Re: start the video at a specific time

Postby sokrakes » 22 Jan 2023 18:09

This is a NULL pointer dereference, and that's pretty much all that can be inferred from the very little info provided.
That's why I'm asking here, if anyone knows how to add the code above or has something working.
I've tried a lot of ways and nothing comes to mind anymore. Finding something functional or that would direct me with libvlc_media_player_set_time hasn't worked.
It would be ideal to add this to the code above for others.

wbtcpip
Blank Cone
Blank Cone
Posts: 14
Joined: 13 May 2021 16:21

Re: start the video at a specific time

Postby wbtcpip » 23 Jan 2023 16:55

the player must be playing or paused before to call libvlc_media_player_set_time

sokrakes
New Cone
New Cone
Posts: 7
Joined: 21 Jan 2023 00:18

Re: start the video at a specific time

Postby sokrakes » 23 Jan 2023 18:36

the player must be playing or paused before to call libvlc_media_player_set_time
Thanks for the kick even though I had it on an already running video so the error was

Code: Select all

libvlc_media_player_set_hwnd(vlcMediaPlayer, Pointer(Panel1.Handle)); libvlc_media_player_play(vlcMediaPlayer); libvlc_media_player_set_time(libvlc_media_player, 170000); should be libvlc_media_player_set_time(vlcMediaPlayer, 170000);

sokrakes
New Cone
New Cone
Posts: 7
Joined: 21 Jan 2023 00:18

Re: start the video at a specific time

Postby sokrakes » 23 Jan 2023 18:51

I added to this code https://wiki.videolan.org/Using_libvlc_with_Delphi

Code: Select all

implementation {$R *.dfm} var .................... libvlc_media_player_set_time : procedure(p_media_player : plibvlc_media_player_t; time : Int64); cdecl; ......................

Code: Select all

/ ----------------------------------------------------------------------------- // Get address of libvlc functions // ----------------------------------------------------------------------------- function LoadVLCFunctions(vlcHandle: integer; failedList: TStringList): Boolean; begin ................ GetAProcAddress(vlcHandle, @libvlc_media_player_set_time, 'libvlc_media_player_set_time', failedList); ............... end;

Code: Select all

..................... // play media libvlc_media_player_play(vlcMediaPlayer); libvlc_media_player_set_time(vlcMediaPlayer, 170000);


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 10 guests