Commit c0c0c4c3 authored by Simon Morlat's avatar Simon Morlat

fix missing mutex locking in x11video filter

parent 4464c094
......@@ -344,9 +344,10 @@ static void pulse_write_preprocess(MSFilter *f){
}
static void pulse_write_process(MSFilter *f){
if(f->data != NULL) {
PlaybackStream *s=(PlaybackStream*)f->data;
PlaybackStream *s=(PlaybackStream*)f->data;
if(s != NULL) {
mblk_t *im;
while((im=ms_queue_get(f->inputs[0]))!=NULL){
int bsize=msgdsize(im);
if (s->stream && s->state == PA_STREAM_READY){
......
......@@ -1778,7 +1778,7 @@ static void recorder_init(MSFilter *f) {
obj->inputDescsList = (const MSFmtDescriptor **)ms_new0(const MSFmtDescriptor *, f->desc->ninputs);
obj->modulesList = (Module **)ms_new0(Module *, f->desc->ninputs);
obj->timeLoopCancelers = (TimeLoopCanceler **)ms_new0(TimeLoopCanceler *, f->desc->ninputs);
obj->timeLoopCancelers = (TimeLoopCanceler **)ms_new0(TimeLoopCanceler *, f->desc->ninputs);
time_corrector_init(&obj->timeCorrector, f->desc->ninputs);
......@@ -1800,7 +1800,7 @@ static void recorder_uninit(MSFilter *f){
if(obj->timeLoopCancelers[i] != NULL) ms_free(obj->timeLoopCancelers[i]);
}
time_corrector_uninit(&obj->timeCorrector);
ms_free(obj->timeLoopCancelers);
ms_free(obj->timeLoopCancelers);
ms_free(obj->modulesList);
ms_free(obj->inputDescsList);
ms_free(obj);
......
......@@ -353,8 +353,10 @@ static void x11video_process(MSFilter *f){
bool_t local_precious=FALSE;
XWindowAttributes wa;
ms_filter_lock(f);
if ((obj->window_id == 0) || (x11_error == TRUE)) goto end;
XGetWindowAttributes(obj->display,obj->window_id,&wa);
if (x11_error == TRUE) {
ms_error("Could not get window attributes for window %lu", obj->window_id);
......@@ -364,9 +366,10 @@ static void x11video_process(MSFilter *f){
ms_warning("Resized to %ix%i", wa.width,wa.height);
obj->wsize.width=wa.width;
obj->wsize.height=wa.height;
XClearWindow(obj->display,obj->window_id);
}
ms_filter_lock(f);
if (!obj->show) {
goto end;
}
......@@ -532,6 +535,7 @@ static int x11video_get_native_window_id(MSFilter *f, void*arg){
static int x11video_set_native_window_id(MSFilter *f, void*arg){
X11Video *s=(X11Video*)f->data;
unsigned long id=*(unsigned long*)arg;
ms_filter_lock(f);
if(id != MS_FILTER_VIDEO_NONE) {
x11video_unprepare(f);
s->autofit=FALSE;
......@@ -542,6 +546,7 @@ static int x11video_set_native_window_id(MSFilter *f, void*arg){
s->window_id=0;
s->auto_window=FALSE;
}
ms_filter_unlock(f);
return 0;
}
......
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