fixed crash at mediaplayer closing, fixed tsmf event parameters-no video, fixed tsmf no audio.
This commit is contained in:
parent
26c054d7a4
commit
be7ff45a52
@ -108,6 +108,8 @@ struct _TSMF_STREAM
|
|||||||
HANDLE stopEvent;
|
HANDLE stopEvent;
|
||||||
HANDLE ready;
|
HANDLE ready;
|
||||||
|
|
||||||
|
BOOL started;
|
||||||
|
|
||||||
wQueue *sample_list;
|
wQueue *sample_list;
|
||||||
wQueue *sample_ack_list;
|
wQueue *sample_ack_list;
|
||||||
};
|
};
|
||||||
@ -675,6 +677,13 @@ static void tsmf_stream_start(TSMF_STREAM* stream)
|
|||||||
if (!stream || !stream->presentation || !stream->decoder)
|
if (!stream || !stream->presentation || !stream->decoder)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!stream->started)
|
||||||
|
{
|
||||||
|
ResumeThread(stream->play_thread);
|
||||||
|
ResumeThread(stream->ack_thread);
|
||||||
|
stream->started = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (stream->decoder->Control)
|
if (stream->decoder->Control)
|
||||||
{
|
{
|
||||||
stream->decoder->Control(stream->decoder, Control_Resume, NULL);
|
stream->decoder->Control(stream->decoder, Control_Resume, NULL);
|
||||||
@ -690,6 +699,12 @@ static void tsmf_stream_stop(TSMF_STREAM* stream)
|
|||||||
{
|
{
|
||||||
stream->decoder->Control(stream->decoder, Control_Stop, NULL);
|
stream->decoder->Control(stream->decoder, Control_Stop, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stream->started)
|
||||||
|
{
|
||||||
|
//SetEvent(stream->stopEvent);
|
||||||
|
stream->started = FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tsmf_stream_pause(TSMF_STREAM* stream)
|
static void tsmf_stream_pause(TSMF_STREAM* stream)
|
||||||
@ -977,8 +992,10 @@ TSMF_STREAM* tsmf_stream_new(TSMF_PRESENTATION* presentation, UINT32 stream_id)
|
|||||||
stream->sample_list->object.fnObjectFree = tsmf_sample_free;
|
stream->sample_list->object.fnObjectFree = tsmf_sample_free;
|
||||||
stream->sample_ack_list = Queue_New(TRUE, -1, -1);
|
stream->sample_ack_list = Queue_New(TRUE, -1, -1);
|
||||||
stream->sample_ack_list->object.fnObjectFree = tsmf_sample_free;
|
stream->sample_ack_list->object.fnObjectFree = tsmf_sample_free;
|
||||||
stream->play_thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) tsmf_stream_playback_func, stream, 0, NULL);
|
|
||||||
stream->ack_thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)tsmf_stream_ack_func, stream, 0, NULL);
|
stream->started = FALSE;
|
||||||
|
stream->play_thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) tsmf_stream_playback_func, stream, CREATE_SUSPENDED, NULL);
|
||||||
|
stream->ack_thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)tsmf_stream_ack_func, stream, CREATE_SUSPENDED, NULL);
|
||||||
|
|
||||||
ArrayList_Add(presentation->stream_list, stream);
|
ArrayList_Add(presentation->stream_list, stream);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user