Defaults for PAL/NTSC on producers and consumers
[melted] / src / modules / avformat / producer_avformat.c
index 1f70b17..3186007 100644 (file)
@@ -469,14 +469,14 @@ static void producer_set_up_video( mlt_producer this, mlt_frame frame )
        // Get the video_index
        int index = mlt_properties_get_int( properties, "video_index" );
 
+       // Get the frame properties
+       mlt_properties frame_properties = mlt_frame_properties( frame );
+
        // Lock the mutex now
        pthread_mutex_lock( &avformat_mutex );
 
        if ( context != NULL && index != -1 )
        {
-               // Get the frame properties
-               mlt_properties frame_properties = mlt_frame_properties( frame );
-
                // Get the video stream
                AVStream *stream = context->streams[ index ];
 
@@ -507,7 +507,6 @@ static void producer_set_up_video( mlt_producer this, mlt_frame frame )
                                        aspect_ratio = ( double )codec_context->width / ( double )codec_context->height;
 
                                mlt_properties_set_double( properties, "aspect_ratio", aspect_ratio );
-                               fprintf( stderr, "avformat: %dx%d (%f)\n", codec_context->width, codec_context->height, av_q2d( codec_context->sample_aspect_ratio ) );
 
                                // Now store the codec with its destructor
                                mlt_properties_set_data( properties, "video_codec", codec_context, 0, producer_codec_close, NULL );
@@ -528,6 +527,14 @@ static void producer_set_up_video( mlt_producer this, mlt_frame frame )
                        mlt_frame_push_get_image( frame, producer_get_image );
                        mlt_properties_set_data( frame_properties, "avformat_producer", this, 0, NULL, NULL );
                }
+               else
+               {
+                       mlt_properties_set_int( frame_properties, "test_image", 1 );
+               }
+       }
+       else
+       {
+               mlt_properties_set_int( frame_properties, "test_image", 1 );
        }
 
        // Unlock the mutex now