A hack to inform Cocoa that is should be multithreaded by spinning of a dummy thread.
[melted] / src / modules / sdl / consumer_sdl_still.c
index f9e3aa7..f2146f5 100644 (file)
@@ -158,8 +158,6 @@ static int consumer_start( mlt_consumer parent )
 
        if ( !this->running )
        {
-               pthread_attr_t thread_attributes;
-
                // Attach a colour space converter
                if ( !this->filtered )
                {
@@ -185,11 +183,7 @@ static int consumer_start( mlt_consumer parent )
 
                //this->width = this->height * this->display_aspect;
 
-               // Inherit the scheduling priority
-               pthread_attr_init( &thread_attributes );
-               pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
-
-               pthread_create( &this->thread, &thread_attributes, consumer_thread, this );
+               pthread_create( &this->thread, NULL, consumer_thread, this );
        }
 
        return 0;
@@ -418,7 +412,7 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
        }
        else
        {
-               changed = mlt_properties_get_int( properties, "changed" ) | mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "refresh" );
+               changed = 1;
                mlt_properties_set_int( properties, "changed", 0 );
        }
 
@@ -569,6 +563,10 @@ static void *consumer_thread( void *arg )
                        consumer_play_video( this, frame );
                        mlt_frame_close( frame );
                }
+               else
+               {
+                       this->running = 0;
+               }
        }
 
        if ( mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "sdl_started" ) == 0 )