X-Git-Url: http://git.tdb.fi/?p=xinema.git;a=blobdiff_plain;f=source%2Fxineengine.cpp;h=3da036b33934a76ad20a6ac2a3e18e330865027d;hp=5dadc93a5c7cfb35c23ffba992d871d23a166290;hb=649ced5849086abe7711d588f95a48677936515a;hpb=1121fb0b32566bfb33f02a7ac5c8935fc0732314 diff --git a/source/xineengine.cpp b/source/xineengine.cpp index 5dadc93..3da036b 100644 --- a/source/xineengine.cpp +++ b/source/xineengine.cpp @@ -9,11 +9,8 @@ using namespace std; using namespace Msp; -XineEngine::XineEngine(Graphics::Window &w, Mutex *m): +XineEngine::XineEngine(Graphics::Window &w): window(w), - display_mutex(m), - locked_thread(0), - lock_count(0), pending_expose(0) { engine = xine_new(); @@ -33,18 +30,10 @@ XineEngine::XineEngine(Graphics::Window &w, Mutex *m): visual.user_data = this; visual.dest_size_cb = &dest_size_cb; visual.frame_output_cb = &frame_output_cb; - if(display_mutex) - { - visual.lock_display = &lock_cb; - visual.unlock_display = &unlock_cb; - } - else - { - visual.lock_display = 0; - visual.unlock_display = 0; - } + visual.lock_display = 0; + visual.unlock_display = 0; - video_driver = xine_open_video_driver(engine, "auto", XINE_VISUAL_TYPE_X11_2, &visual); + video_driver = xine_open_video_driver(engine, "auto", XINE_VISUAL_TYPE_X11, &visual); if(!video_driver) throw runtime_error("Could not open video driver"); @@ -108,30 +97,3 @@ void XineEngine::frame_output_cb(void *user_data, int, int, double, int *dest_x, *win_x = 0; *win_y = 0; } - -void XineEngine::lock_cb(void *user_data) -{ - XineEngine &engine = *reinterpret_cast(user_data); - pthread_t tid = pthread_self(); - if(tid==engine.locked_thread) - ++engine.lock_count; - else - { - engine.display_mutex->lock(); - engine.locked_thread = tid; - engine.lock_count = 1; - } -} - -void XineEngine::unlock_cb(void *user_data) -{ - XineEngine &engine = *reinterpret_cast(user_data); - pthread_t tid = pthread_self(); - if(tid!=engine.locked_thread) - throw logic_error("Unlock from non-locked thread"); - if(!--engine.lock_count) - { - engine.locked_thread = 0; - engine.display_mutex->unlock(); - } -}