Two threads are involved in opening file?

This forum is about all development around libVLC.
mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Two threads are involved in opening file?

Postby mangup » 02 May 2019 00:05

Hi,
Why do I see two threads involved in opening file when I stop on breakpoint in static int Open( vlc_object_t * p_this ) function? (at /vlc/modules/demux/mp4/mp4.c)


Image

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

Re: Two threads are involved in opening file?

Postby unidan » 04 May 2019 12:57

Hi, why do you assume both threads are for opening the file ?

try "thread apply all backtrace" to see what each thread is doing.

mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Re: Two threads are involved in opening file?

Postby mangup » 06 May 2019 02:21

because I see 2 thread stack on left pane and cursor jump from one to another from step to step. "thread apply all backtrace" doesn't change the behaviour.

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

Re: Two threads are involved in opening file?

Postby unidan » 06 May 2019 14:07

"thread apply all backtrace" doesn't change a behaviour, it displays the current callstack of each thread.

I can't really know what your left pane is or what you're doing though.

mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Re: Two threads are involved in opening file?

Postby mangup » 06 May 2019 14:41

ok. You can add line
"fprintf( stderr, "static int Open in thread %lu\n", vlc_thread_id () );"
to the "static int Open( vlc_object_t * p_this )" function in /vlc/modules/demux/mp4/mp4.c file.
Run and see the output:
"
static int Open in thread 5489
static int Open in thread 5488
"
My question is: why the player opens the file twice?

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

Re: Two threads are involved in opening file?

Postby unidan » 09 May 2019 11:35

One time is for preparsing, the second time is for actually playing it.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 19 guests