]> git.sesse.net Git - mlt/commitdiff
Validate that swscale supports the resolution in avformat producer.
authorDan Dennedy <dan@dennedy.org>
Mon, 13 Sep 2010 00:15:47 +0000 (17:15 -0700)
committerDan Dennedy <dan@dennedy.org>
Mon, 13 Sep 2010 00:15:47 +0000 (17:15 -0700)
src/modules/avformat/producer_avformat.c

index 0f3132092187a84d3dcb67b049de00bf79a700b9..a7f79137335e515c5dc9d09d2eb8dcffa56e18d0 100644 (file)
@@ -573,6 +573,12 @@ static int producer_open( producer_avformat this, mlt_profile profile, char *fil
                                        mlt_properties_set_double( properties, "aspect_ratio",
                                                get_aspect_ratio( context->streams[ video_index ], codec_context, NULL ) );
                                }
+                               struct SwsContext *context = sws_getContext( codec_context->width, codec_context->height, codec_context->pix_fmt,
+                                       codec_context->width, codec_context->height, PIX_FMT_YUYV422, SWS_BILINEAR, NULL, NULL, NULL);
+                               if ( context )
+                                       sws_freeContext( context );
+                               else
+                                       error = 1;
                        }
 
                        // Read Metadata