]> git.sesse.net Git - mlt/commitdiff
Use denominators as the litmus test for generating profile.
authorDan Dennedy <dan@dennedy.org>
Sun, 26 Sep 2010 19:32:43 +0000 (12:32 -0700)
committerDan Dennedy <dan@dennedy.org>
Thu, 7 Oct 2010 05:19:14 +0000 (22:19 -0700)
This allows converting all producers to meta.media.width and
meta.media.height while not attempting to auto-profile the image
producers, which can potentially hold extremely large images and do not
contain any inherent frame rate. This also protects from potential
divide by zero errors.

src/melt/melt.c

index c9681ff794cf79597f9800f3a87b15a84b5e999b..7cd53a46423913008dbda74f9b8ea0f6434bce8f 100644 (file)
@@ -353,7 +353,7 @@ static void guess_profile( mlt_producer melt, mlt_profile profile )
                        mlt_frame_close( fr );
                        mlt_service_get_frame( MLT_PRODUCER_SERVICE(melt), &fr, 0 );
                        p = MLT_FRAME_PROPERTIES( fr );
-                       if ( mlt_properties_get_int( p, "meta.media.width" ) )
+                       if ( mlt_properties_get_int( p, "meta.media.frame_rate_den" ) && mlt_properties_get_int( p, "meta.media.sample_aspect_den" ) )
                        {
                                profile->width = mlt_properties_get_int( p, "meta.media.width" );
                                profile->height = mlt_properties_get_int( p, "meta.media.height" );