X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Favformat%2Fconsumer_avformat.c;h=6bb672a1ba489d5be8be0d14daedc9a3371e4a03;hb=f5da31bf950521eaef7fc1f7047603e28cbbb377;hp=753280256fdd92e1b71b67a9602a6e84c68bcdce;hpb=9215d84f33d395232a752c6fe5b1cb20a50459ec;p=melted diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c index 7532802..6bb672a 100644 --- a/src/modules/avformat/consumer_avformat.c +++ b/src/modules/avformat/consumer_avformat.c @@ -851,6 +851,7 @@ static void *consumer_thread( void *arg ) uint8_t *p; uint8_t *q; + mlt_events_fire( properties, "consumer-frame-show", frame, NULL ); mlt_frame_get_image( frame, &image, &img_fmt, &img_width, &img_height, 0 ); q = image; @@ -920,8 +921,11 @@ static void *consumer_thread( void *arg ) if ( real_time_output && frames % 25 == 0 ) { long passed = time_difference( &ante ); - long pending = ( ( ( long )sample_fifo_used( fifo ) * 1000 ) / frequency ) * 1000; - passed -= pending; + if ( fifo != NULL ) + { + long pending = ( ( ( long )sample_fifo_used( fifo ) * 1000 ) / frequency ) * 1000; + passed -= pending; + } if ( passed < total_time ) { long total = ( total_time - passed ); @@ -962,6 +966,8 @@ static void *consumer_thread( void *arg ) // Just in case we terminated on pause mlt_properties_set_int( properties, "running", 0 ); + mlt_consumer_stopped( this ); + return NULL; }