Page 1 of 1

Two threads are involved in opening file?

Posted: 02 May 2019 00:05
by mangup
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

Re: Two threads are involved in opening file?

Posted: 04 May 2019 12:57
by unidan
Hi, why do you assume both threads are for opening the file ?

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

Re: Two threads are involved in opening file?

Posted: 06 May 2019 02:21
by mangup
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.

Re: Two threads are involved in opening file?

Posted: 06 May 2019 14:07
by unidan
"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.

Re: Two threads are involved in opening file?

Posted: 06 May 2019 14:41
by mangup
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?

Re: Two threads are involved in opening file?

Posted: 09 May 2019 11:35
by unidan
One time is for preparsing, the second time is for actually playing it.