]> git.sesse.net Git - mlt/commitdiff
Fix crashing when using opengl services with wrapper producers.
authorDan Dennedy <dan@dennedy.org>
Fri, 4 Apr 2014 23:48:32 +0000 (16:48 -0700)
committerDan Dennedy <dan@dennedy.org>
Fri, 4 Apr 2014 23:48:32 +0000 (16:48 -0700)
Steinar reported crashing in Kdenlive when using the framebuffer
producer due to movit.crop changing the format to mlt_image_none.
Removing that required making other components handle requests with
format = mlt_image_none.

src/framework/mlt_frame.c
src/modules/core/producer_colour.c
src/modules/gtk2/producer_pixbuf.c
src/modules/opengl/filter_movit_crop.cpp
src/modules/qt/qimage_wrapper.cpp

index baf9d8d5488f43e9641da7ad10eeb7cf5911e773..da7bb8e04a8a81af6c5f18f55b52170357e3923b 100644 (file)
@@ -509,6 +509,9 @@ static int generate_test_image( mlt_properties properties, uint8_t **buffer,  ml
                                if ( *buffer )
                                        memset( *buffer, 255, size );
                                break;
+                       case mlt_image_glsl:
+                       case mlt_image_glsl_texture:
+                               *format = mlt_image_yuv422;
                        case mlt_image_yuv422:
                                size *= 2;
                                size += *width * 2;
index bb9427cc40d2783f8983739c601facce6f15fd83..80ca7a61b79e97ca4afe687bb5d6cc44845747ce 100644 (file)
@@ -88,7 +88,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        mlt_color color = mlt_properties_get_color( producer_props, "resource" );
 
        // Choose suitable out values if nothing specific requested
-       if ( *format == mlt_image_none )
+       if ( *format == mlt_image_none || *format == mlt_image_glsl )
                *format = mlt_image_rgb24a;
        if ( *width <= 0 )
                *width = mlt_service_profile( MLT_PRODUCER_SERVICE(producer) )->width;
index 1ec705e3e6fd4e8e24d3524079accccfadda1760..e155f4031d54df6a5eb526cbc30adf774d4e610c 100644 (file)
@@ -442,7 +442,7 @@ static void refresh_image( producer_pixbuf self, mlt_frame frame, mlt_image_form
                self->image, self->pixbuf, current_idx, self->image_idx, self->pixbuf_idx, width );
 
        // If we have a pixbuf and we need an image
-       if ( self->pixbuf && ( !self->image || ( format != mlt_image_none && format != self->format ) ) )
+       if ( self->pixbuf && ( !self->image || ( format != mlt_image_none && format != mlt_image_glsl && format != self->format ) ) )
        {
                char *interps = mlt_properties_get( properties, "rescale.interp" );
                if ( interps ) interps = strdup( interps );
@@ -495,7 +495,7 @@ static void refresh_image( producer_pixbuf self, mlt_frame frame, mlt_image_form
                pthread_mutex_unlock( &g_mutex );
 
                // Convert image to requested format
-               if ( format != mlt_image_none && format != self->format )
+               if ( format != mlt_image_none && format != mlt_image_glsl && format != self->format )
                {
                        uint8_t *buffer = NULL;
 
index 24ae8702d298bc2e8d1c34b0b952a914326aba69..0dee4b9ca56aa990c7dee88c95dba6bec38e537e 100644 (file)
@@ -53,9 +53,6 @@ static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format
 
        // Get the image as requested
 //     *format = (mlt_image_format) mlt_properties_get_int( MLT_PRODUCER_PROPERTIES(producer), "_movit image_format" );
-       *format = mlt_image_none;
-       if ( mlt_properties_get_int( properties, "test_image" ) )
-               *format = mlt_image_yuv422;
        error = mlt_frame_get_image( frame, image, format, width, height, writable );
 
        // Skip processing if requested.
index ee5db0b13dd0d0aab0af3b9741a8c88d7d52bee9..850a7e4e43f4f5a8587cb894709cdbd76a46e7ca 100644 (file)
@@ -222,7 +222,7 @@ void refresh_image( producer_qimage self, mlt_frame frame, mlt_image_format form
                self->current_image = NULL;
 
        // If we have a qimage and need a new scaled image
-       if ( self->qimage && ( !self->current_image || ( format != mlt_image_none  && format != self->format ) ) )
+       if ( self->qimage && ( !self->current_image || ( format != mlt_image_none && format != mlt_image_glsl && format != self->format ) ) )
        {
                QString interps = mlt_properties_get( properties, "rescale.interp" );
                bool interp = ( interps != "nearest" ) && ( interps != "none" );
@@ -269,7 +269,7 @@ void refresh_image( producer_qimage self, mlt_frame frame, mlt_image_format form
                }
 
                // Convert image to requested format
-               if ( format != mlt_image_none && format != self->format )
+               if ( format != mlt_image_none && format != mlt_image_glsl && format != self->format )
                {
                        uint8_t *buffer = NULL;