2012/2/9 Maksym Veremeyenko <ve...@m1stereo.tv>:
> 08.02.12 20:11, Dan Dennedy написав(ла):
> [...]
>
>> Well, the more critical goal was to fix a segfault, but I see your
>> point now about using "running" to cleanup "thread." I did not like
>> your conversion of the thread property from data to a int64; do you
>> know how data properties provide destruction? Also, my testing
>> revealed some additional pointer checks required inside
>> consumer_thread. Comment on this applied to head:
>>
>> diff --git a/src/modules/avformat/consumer_avformat.c
>> b/src/modules/avformat/consumer_avformat.c
>> index fb52df3..cd63431 100644
>> --- a/src/modules/avformat/consumer_avformat.c
>> +++ b/src/modules/avformat/consumer_avformat.c
>> @@ -350,18 +350,18 @@ static int consumer_stop( mlt_consumer consumer )
>>  {
>>        // Get the properties
>>        mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
>> +       pthread_t *thread = mlt_properties_get_data( properties, "thread",
>> NULL );
>>
>>        // Check that we're running
>> -       if ( mlt_properties_get_int( properties, "running" ) )
>> +       if ( thread )
>>        {
>> -               // Get the thread
>> -               pthread_t *thread = mlt_properties_get_data( properties,
>> "thread", NULL );
>> -
>>                // Stop the thread
>>                mlt_properties_set_int( properties, "running", 0 );
>>
>>                // Wait for termination
>>                pthread_join( *thread, NULL );
>
> what about swapping two lines above - set flag running after pthread_join
> return?

The main loop in the consumer checks the running property, so we need
to set it 0 to signal termination before the join.

-- 
+-DRD-+

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to