libvlc_media_player_set_position fails when seeking backward

This forum is about all development around libVLC.
seleciii44
New Cone
New Cone
Posts: 6
Joined: 15 Dec 2015 12:26
VLC version: 3.0.0
Operating System: windows 7

libvlc_media_player_set_position fails when seeking backward

Postby seleciii44 » 15 Dec 2015 12:38

I'm using libvlc 3.0.0 (i've also tried 2.2.0) to capture frames from h264 encoded mp4 file(does not include sound, only video frames) on windows 7 with Visual Studio 2012. I can play, pause, stop and seek forward without any problem. But when i try to seek backward, i've got problems:
1. scenario: If I only call libvlc_media_player_set_position (or libvlc_media_player_set_time), it seems like it goes to the position. But vlc stops sending frame received callbacks(in other words,player freezes) until it reaches the same(or next) frame before the libvlc_media_player_set_position function called.

Code: Select all

counter = 0; while (true) { sleep(40); //25 hz ++counter; if(counter % 100 = 0) {// assuming current_position > 0.1f libvlc_media_player_set_position(p_mi, 0.1f); } }
2. Scenario: I can make it work, if only I first stop the player, then start playing from the beginning.

Code: Select all

counter = 0; while (true) { sleep(40); //25 hz ++counter; if(counter % 100 = 0) {// assuming current_position > 0.1f libvlc_media_player_stop(p_mi); libvlc_media_player_play(p_mi); libvlc_media_player_set_position(p_mi, 0.1f); } }
The problem with this scenario is, if I keep backward positioning for a while, i get the error (vlc prints the error to the command line) core decoder error: cannot continue streaming due to errors. After this error it stops playing(freezes again), and the next time I try to seek, I get an "Access violation" error: Unhandled exception at 0x... (libavcodec_plugin.dll) in vlctest.exe: 0xC0000005: Access violation reading location 0x00000040


It already feels wrong to first restarting (stop + play) video for seeking. Am I missing something?

(By the way, it's the same question at http://stackoverflow.com/questions/3426 ... g-backward)

Thanks in advance, Gokhan.

seleciii44
New Cone
New Cone
Posts: 6
Joined: 15 Dec 2015 12:26
VLC version: 3.0.0
Operating System: windows 7

Re: libvlc_media_player_set_position fails when seeking backward

Postby seleciii44 » 17 Dec 2015 18:43

I'm still desperate here for a clue. Any ideas please?

seleciii44
New Cone
New Cone
Posts: 6
Joined: 15 Dec 2015 12:26
VLC version: 3.0.0
Operating System: windows 7

Re: libvlc_media_player_set_position fails when seeking backward

Postby seleciii44 » 29 Dec 2015 13:15

I don't know where did i messed it up before, but i downloaded the current nightly build vlc-3.0.0-git-20151221-0002-win32-debug.zip and it works now.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 26 guests