Code: Select all
0 4716 Main Thread Main Thread NtWaitForSingleObject Normal 0
0 2412 Worker Thread CreateApplicationContext NtWaitForMultipleObjects Highest 0
0 2356 Worker Thread CreateHistoryReader NtWaitForSingleObject Normal 0
0 4592 Worker Thread RtlLoadString NtWaitForMultipleObjects Normal 0
0 3788 Worker Thread GdipCreateSolidFill NtWaitForMultipleObjects Normal 0
0 3808 Worker Thread RtlDosSearchPath_Ustr NtWaitForWorkViaWorkerFactory Normal 0
0 3576 Worker Thread CreateApplicationContext VG.VGAM.EventQueueProcessor Normal 0
0 5028 Worker Thread CreateApplicationContext GetPropW Normal 0
0 3992 Worker Thread TranslateSecurityAttributes NtDelayExecution Normal 0
0 4288 Worker Thread Win32 Thread NtRemoveIoCompletion Above Normal 0
0 1500 Worker Thread CreateApplicationContext GetPropW Normal 0
0 1408 Worker Thread CreateApplicationContext NtDelayExecution Normal 0
0 4984 Worker Thread CreateApplicationContext VG.VGAMClientConnection.CheckConnectionState Normal 0
0 5116 Worker Thread _endthreadex NtWaitForSingleObject Normal 0
0 5304 Worker Thread _endthreadex NtWaitForSingleObject Normal 0
0 3772 Worker Thread RtlDosSearchPath_Ustr NtWaitForWorkViaWorkerFactory Normal 0
0 4804 Worker Thread _endthreadex NtWaitForSingleObject Normal 0
0 1416 Worker Thread _endthreadex NtWaitForSingleObject Above Normal 0
0 6492 Worker Thread _endthreadex GetPropW Normal 0
0 5860 Worker Thread RtlDosSearchPath_Ustr NtWaitForWorkViaWorkerFactory Normal 0
[main thread]
ntdll.dll!NtWaitForSingleObject() + 0x15 bytes
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
kernel32.dll!WaitForSingleObjectEx() + 0x43 bytes
libvlccore.dll!vlc_join() + 0x2f bytes
libvlccore.dll!vout_Close() + 0x62 bytes
libvlccore.dll!input_resource_Delete() + 0x565 bytes
libvlccore.dll!input_resource_TerminateVout() + 0x23 bytes
libvlc.dll!libvlc_media_player_stop() + 0x6e bytes
libvlc.dll!libvlc_media_list_player_stop() + 0x41 bytes
[thread 5116]
> ntdll.dll!NtWaitForSingleObject() + 0x15 bytes
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
kernel32.dll!WaitForSingleObjectEx() + 0x43 bytes
libvlccore.dll!vlc_cond_wait() + 0x4c bytes
libvlc.dll!libvlc_event_attach() + 0x118 bytes
libvlccore.dll!vlc_sem_post() + 0x7a bytes
msvcrt.dll!_itow_s() + 0x4c bytes
msvcrt.dll!_endthreadex() + 0x6c bytes
kernel32.dll!BaseThreadInitThunk() + 0x12 bytes
ntdll.dll!RtlInitializeExceptionChain() + 0x63 bytes
ntdll.dll!RtlInitializeExceptionChain() + 0x36 bytes
[thread 5304]
> ntdll.dll!NtWaitForSingleObject() + 0x15 bytes
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
kernel32.dll!WaitForSingleObjectEx() + 0x43 bytes
libvlccore.dll!vlc_cond_wait() + 0x4c bytes
libvlc.dll!libvlc_event_attach() + 0x118 bytes
libvlccore.dll!vlc_sem_post() + 0x7a bytes
msvcrt.dll!_itow_s() + 0x4c bytes
msvcrt.dll!_endthreadex() + 0x6c bytes
kernel32.dll!BaseThreadInitThunk() + 0x12 bytes
ntdll.dll!RtlInitializeExceptionChain() + 0x63 bytes
ntdll.dll!RtlInitializeExceptionChain() + 0x36 bytes
[thread 4804]
> ntdll.dll!NtWaitForSingleObject() + 0x15 bytes
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
kernel32.dll!WaitForSingleObjectEx() + 0x43 bytes
libvlccore.dll!vlc_cond_wait() + 0x4c bytes
libvlc.dll!libvlc_event_attach() + 0x118 bytes
libvlccore.dll!vlc_sem_post() + 0x7a bytes
msvcrt.dll!_itow_s() + 0x4c bytes
msvcrt.dll!_endthreadex() + 0x6c bytes
kernel32.dll!BaseThreadInitThunk() + 0x12 bytes
ntdll.dll!RtlInitializeExceptionChain() + 0x63 bytes
ntdll.dll!RtlInitializeExceptionChain() + 0x36 bytes
[thread 1416]
> ntdll.dll!NtWaitForSingleObject() + 0x15 bytes
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
kernel32.dll!WaitForSingleObjectEx() + 0x43 bytes
libvlccore.dll!vlc_join() + 0x2f bytes
libdirect3d_plugin.dll!vlc_entry__1_1_0g() + 0x286f bytes
libdirect3d_plugin.dll!vlc_entry__1_1_0g() + 0x597a bytes
libdirect3d_plugin.dll!vlc_entry__1_1_0g() + 0x1e8d bytes
libvlccore.dll!module_unneed() + 0x21 bytes
libvlccore.dll!vout_DeleteDisplay() + 0x5e bytes
libvout_wrapper_plugin.dll!vlc_entry__1_1_0g() + 0x22f bytes
libvlccore.dll!module_unneed() + 0x21 bytes
libvlccore.dll!vout_Close() + 0x2128 bytes
libvlccore.dll!vlc_sem_post() + 0x7a bytes
msvcrt.dll!_itow_s() + 0x4c bytes
msvcrt.dll!_endthreadex() + 0x6c bytes
kernel32.dll!BaseThreadInitThunk() + 0x12 bytes
ntdll.dll!RtlInitializeExceptionChain() + 0x63 bytes
ntdll.dll!RtlInitializeExceptionChain() + 0x36 bytes
Code: Select all
do
vlc_testcancel ();
while (WaitForSingleObjectEx (handle, INFINITE, TRUE)== WAIT_IO_COMPLETION);
Code: Select all
void vlc_testcancel (void)
{
vlc_cancel_t *nfo = (vlc_cancel_t *)vlc_threadvar_get (cancel_key); // sunqueen modify
if (nfo == NULL)
return; /* Main thread - cannot be cancelled anyway */
if (nfo->killable && nfo->killed)
{
for (vlc_cleanup_t *p = nfo->cleaners; p != NULL; p = p->next)
p->proc (p->data);
#ifndef UNDER_CE
_endthread ();
#else
ExitThread(0);
#endif
}
}
Code: Select all
/*** Thread cancellation ***/
/* APC procedure for thread cancellation */
static void CALLBACK vlc_cancel_self (ULONG_PTR dummy)
{
vlc_cancel_t *nfo = vlc_threadvar_get (cancel_key);
if (likely(nfo != NULL))
nfo->killed = true;
(void)dummy;
}
Code: Select all
/*** Thread cancellation ***/
/* APC procedure for thread cancellation */
-static void CALLBACK vlc_cancel_self (ULONG_PTR dummy)
+static void CALLBACK vlc_cancel_self (ULONG_PTR self)
{
- struct vlc_thread *th = vlc_threadvar_get (thread_key);
+ struct vlc_thread *th = (void *)self;
if (likely(th != NULL))
th->killed = true;
-
- (void)dummy;
}
Code: Select all
void vlc_cancel (vlc_thread_t thread_id)
{
#ifndef UNDER_CE
QueueUserAPC (vlc_cancel_self, thread_id, 0); <---- BREAKPOINT
#else
SetEvent (thread_id->cancel_event);
#endif
}
Code: Select all
libvlc_media_player_set_hwnd(pvideo->mp, NULL);
libvlc_media_player_stop(pvideo->mp);
libvlc_media_player_release(pvideo->mp);
libvlc_release(pvideo->vlcinst);
Most probably the [handle] thread is stuck and refuses to exit, so the loop condition never breaks. I doubt it's an issue with vlc_testcancel() and the APC stuff. You can easily test that by removing vlc_testcancel() from the while-loop.I think i have the same problem. I have more then one player in my appilcation and in same cases
if i will stop one of the players.
I always gets a infinite loop by call vlc_join(vlc_thread_t handle, void **result) (src/win32/thread.c) cause this do-while loop never ends(...)Code: Select all
do vlc_testcancel (); while (WaitForSingleObjectEx (handle, INFINITE, TRUE)== WAIT_IO_COMPLETION);
can somebody explain me the change?
With a timeout specified as INFINITE in the following code, a deadlock can occur randomly since no messages will be able to be processed:Use caution when calling the wait functions and code that directly or indirectly creates windows. If a thread creates any windows, it must process messages. Message broadcasts are sent to all windows in the system. A thread that uses a wait function with no time-out interval may cause the system to become deadlocked. Two examples of code that indirectly creates windows are DDE and the CoInitialize function. Therefore, if you have a thread that creates windows, use MsgWaitForMultipleObjects or MsgWaitForMultipleObjectsEx, rather than WaitForSingleObjectEx.
Code: Select all
do
vlc_testcancel ();
while (WaitForSingleObjectEx (handle, INFINITE, TRUE) == WAIT_IO_COMPLETION);
Return to “Development around libVLC”
Users browsing this forum: No registered users and 3 guests