]> git.sesse.net Git - mlt/commitdiff
Possible fixes to xlib errors
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 3 Dec 2004 12:25:01 +0000 (12:25 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 3 Dec 2004 12:25:01 +0000 (12:25 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@550 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_consumer.c
src/modules/data_fx.properties
src/modules/sdl/consumer_sdl_preview.c
src/modules/sdl/consumer_sdl_still.c

index e353f63daba0e547948e23274f918e122f767aba..20200962c1bea6c3c323bad38c440b7ca6ed18ea 100644 (file)
@@ -222,7 +222,7 @@ int mlt_consumer_put_frame( mlt_consumer this, mlt_frame frame )
                        tm.tv_nsec = now.tv_usec * 1000;
                        pthread_cond_timedwait( &this->put_cond, &this->put_mutex, &tm );
                }
-               if ( this->put == NULL )
+               if ( !mlt_consumer_is_stopped( this ) && this->put == NULL )
                        this->put = frame;
                else
                        mlt_frame_close( frame );
index 5aa77c0f6fca322238312215ea3db32c096e8502..bcfac2097f3ab43b5df1661b55b1d65b7c47ff20 100644 (file)
@@ -157,11 +157,11 @@ shot.filter[0].composite.start=0%,0%:100%x100%:10
 shot.filter[0].composite.key[5]=0%,0%:100%x100%:100
 shot.filter[1]=watermark
 shot.filter[1].resource=pango:
-shot.filter[1].producer.markup=Live
-shot.filter[1].producer.font=San 24
-shot.filter[1].composite.start=1%,1%:99%x99%:10
+shot.filter[1].producer.markup=File Shot
+shot.filter[1].producer.font=San 20
+shot.filter[1].composite.start=1%,1%:99%x99%:15
 shot.filter[1].composite.key[8]=1%,1%:99%x99%:100
-shot.filter[1].composite.titles=1
+shot.filter[1].composite.titles=0
 #shot.filter[1].composite.halign=centre
 
 special=region
index cfb6c0ebbab6e8c7495b96240a4ef0969909da1e..cb2e33c59eba7a1cfe050168fe2f1fd8e35ba7a9 100644 (file)
@@ -178,6 +178,7 @@ static void *consumer_thread( void *arg )
        // internal intialization
        int first = 1;
        mlt_frame frame = NULL;
+       int last_position = -1;
 
        // properties
        mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
@@ -256,6 +257,18 @@ static void *consumer_thread( void *arg )
                        // Make sure the recipient knows that this frame isn't really rendered
                        mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "rendered", 0 );
 
+                       // Optimisation to reduce latency
+                       if ( speed == 1.0 )
+                       {
+                               if ( last_position != -1 && last_position + 1 != mlt_frame_get_position( frame ) )
+                                       mlt_consumer_purge( this->play );
+                               last_position = mlt_frame_get_position( frame );
+                       }
+                       else
+                       {
+                               last_position = -1;
+                       }
+
                        // If we're not the first frame and both consumers are stopped, then stop ourselves
                        if ( !first && mlt_consumer_is_stopped( this->play ) && mlt_consumer_is_stopped( this->still ) )
                        {
index f441352571a71ede942151092628b5dec5940556..6420dfcc9e7e0a0700d34c54e0481556de74acfa 100644 (file)
@@ -123,7 +123,9 @@ mlt_consumer consumer_sdl_still_init( char *arg )
                this->window_height = this->height;
 
                // Set the sdl flags
-               this->sdl_flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_RESIZABLE | SDL_DOUBLEBUF;
+               //this->sdl_flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_RESIZABLE | SDL_DOUBLEBUF;
+               // Experimental settings
+               this->sdl_flags = SDL_RESIZABLE | SDL_DOUBLEBUF;
 
                // Allow thread to be started/stopped
                parent->start = consumer_start;
@@ -486,7 +488,7 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
                mlt_properties_set_int( this->properties, "rect_h", this->rect.h );
        }
        
-       if ( !mlt_consumer_is_stopped( &this->parent ) && this->sdl_screen != NULL && this->sdl_screen->pixels != NULL )
+       if ( !mlt_consumer_is_stopped( &this->parent ) && SDL_GetVideoSurface( ) != NULL && this->sdl_screen != NULL && this->sdl_screen->pixels != NULL )
        {
                memset( this->sdl_screen->pixels, 0, this->window_width * this->window_height * this->sdl_screen->format->BytesPerPixel );
 
@@ -533,7 +535,7 @@ static void *consumer_thread( void *arg )
 
        // internal intialization
        mlt_frame frame = NULL;
-       struct timespec tm = { 0, 99999999 };
+       struct timespec tm = { 0, 10000000 };
 
        if ( mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "sdl_started" ) == 0 )
        {