Commit 20c1bb7f authored by Simon Morlat's avatar Simon Morlat

Attempt to workaround wasapi failures, when the device is open/close

within a short timeframe.
parent 783e6f9e
......@@ -51,7 +51,6 @@ static void ms_wasapi_read_init(MSFilter *f) {
static void ms_wasapi_read_preprocess(MSFilter *f) {
MSWASAPIReaderType r = MSWASAPI_READER(f->data);
r->activate();
}
static void ms_wasapi_read_process(MSFilter *f) {
......@@ -65,10 +64,12 @@ static void ms_wasapi_read_process(MSFilter *f) {
static void ms_wasapi_read_postprocess(MSFilter *f) {
MSWASAPIReaderType r = MSWASAPI_READER(f->data);
r->stop();
r->deactivate();
}
static void ms_wasapi_read_uninit(MSFilter *f) {
MSWASAPIReaderType r = MSWASAPI_READER(f->data);
r->deactivate();
MSWASAPIReaderDelete(static_cast<MSWASAPIReaderPtr>(f->data));
}
......@@ -194,24 +195,22 @@ static void ms_wasapi_write_init(MSFilter *f) {
static void ms_wasapi_write_preprocess(MSFilter *f) {
MSWASAPIWriterType w = MSWASAPI_WRITER(f->data);
w->activate();
w->start();
}
static void ms_wasapi_write_process(MSFilter *f) {
MSWASAPIWriterType w = MSWASAPI_WRITER(f->data);
if (!w->isStarted()) {
w->start();
}
w->feed(f);
}
static void ms_wasapi_write_postprocess(MSFilter *f) {
MSWASAPIWriterType w = MSWASAPI_WRITER(f->data);
w->stop();
w->deactivate();
}
static void ms_wasapi_write_uninit(MSFilter *f) {
w->deactivate();
MSWASAPIWriterType w = MSWASAPI_WRITER(f->data);
MSWASAPIWriterDelete(static_cast<MSWASAPIWriterPtr>(f->data));
}
......
......@@ -146,6 +146,7 @@ void MSWASAPIReader::init(LPCWSTR id)
FREE_PTR(pWfx);
mIsInitialized = true;
smInstantiated = true;
activate();
return;
error:
......
......@@ -146,6 +146,7 @@ void MSWASAPIWriter::init(LPCWSTR id, MSFilter *f) {
FREE_PTR(pWfx);
mIsInitialized = true;
smInstantiated = true;
activate();
return;
error:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment