On Tue, Feb 17, 2015 at 10:59 PM, Dan Dennedy <d...@dennedy.org> wrote:

> On Tue, Feb 17, 2015 at 3:21 PM, jb <j...@kdenlive.org> wrote:
>
>> On Tuesday 17 February 2015 23.29:55 jb wrote:
>>
>> > Please ignore my previous message, I cannot reproduce anymore.
>> > This looks like some of my stuff needed to be recompiled.
>>
>> Well, seems like this is not the end of the story..
>> I can now reproduce the bug again, so if someone else can try...
>>
>> I can now reliably reproduce using png images in a folder, and following
>> MLT
>> command :
>>
>> melt ./.all.png ttl=1 out=50 -consumer sdl_preview
>>
>> Let it play until the end (50 frames), seek back and hit play causes a
>> freeze.
>> Sometimes seeking back and forth is required before the freeze.
>> Small ttl seem to make the freeze happen more frequently
>>
>>
> I can reproduce it with your command line, but I also still reproduce it
> when I revert the commit you refer to: 87ad198. It is not as easy to
> reproduce, but it still reproduces, and the change is needed to allow the
> animation to at least occasionally update video on my system.
> Looking at all of the threads while in the deadlocked state, I see the sdl
> consumer getting stuck on line 876, mlt_consumer_get_frame(), in
> consumer_sdl.c. If I comment out lines from 874-880:
>
>       if ( mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), 
> "put_mode" ) == 1 )
>
>       {
>
>               frame = mlt_consumer_get_frame( consumer );
>
>               if ( frame )
>
>                       mlt_frame_close( frame );
>
>               frame = NULL;
>
>       }
>
>
> Then, I no longer reproduce the problem for this test case. However, now I 
> worry about sdl_preview getting stuck on some call to 
> mlt_consumer_put_frame() if I simply remove those lines. So, I still need to 
> do more analysis and testing.
>
>
>
Here is a patch I am testing at the moment,

-- 
+-DRD-+
diff --git a/src/framework/mlt_consumer.c b/src/framework/mlt_consumer.c
index 23475e2..f4dc1dc 100644
--- a/src/framework/mlt_consumer.c
+++ b/src/framework/mlt_consumer.c
@@ -618,6 +618,7 @@ int mlt_consumer_put_frame( mlt_consumer self, mlt_frame 
frame )
                consumer_private *priv = self->local;
 
                pthread_mutex_lock( &priv->put_mutex );
+               mlt_properties_set_int( MLT_CONSUMER_PROPERTIES(self), 
"put_pending", 1 );
                while ( priv->put_active && priv->put != NULL )
                {
                        gettimeofday( &now, NULL );
@@ -629,6 +630,7 @@ int mlt_consumer_put_frame( mlt_consumer self, mlt_frame 
frame )
                        priv->put = frame;
                else
                        mlt_frame_close( frame );
+               mlt_properties_set_int( MLT_CONSUMER_PROPERTIES(self), 
"put_pending", 0 );
                pthread_cond_broadcast( &priv->put_cond );
                pthread_mutex_unlock( &priv->put_mutex );
        }
diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c
index 94c3232..d874905 100644
--- a/src/modules/sdl/consumer_sdl.c
+++ b/src/modules/sdl/consumer_sdl.c
@@ -871,7 +871,8 @@ static void *consumer_thread( void *arg )
        self->running = 0;
        
        // Unblock sdl_preview
-       if ( mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), 
"put_mode" ) == 1 )
+       if ( mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), 
"put_mode" ) &&
+            mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), 
"put_pending" ) )
        {
                frame = mlt_consumer_get_frame( consumer );
                if ( frame )
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to