summaryrefslogtreecommitdiff
path: root/media-libs/mlt/files/mlt-6.16.0-bad-aspect-ratio-resulting-in-black.patch
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/mlt/files/mlt-6.16.0-bad-aspect-ratio-resulting-in-black.patch')
-rw-r--r--media-libs/mlt/files/mlt-6.16.0-bad-aspect-ratio-resulting-in-black.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/media-libs/mlt/files/mlt-6.16.0-bad-aspect-ratio-resulting-in-black.patch b/media-libs/mlt/files/mlt-6.16.0-bad-aspect-ratio-resulting-in-black.patch
new file mode 100644
index 00000000..c2bc1946
--- /dev/null
+++ b/media-libs/mlt/files/mlt-6.16.0-bad-aspect-ratio-resulting-in-black.patch
@@ -0,0 +1,56 @@
+From f0628d1fe7f61a267f1adad8824b9a2083e3376a Mon Sep 17 00:00:00 2001
+From: Dan Dennedy <dan@dennedy.org>
+Date: Fri, 31 May 2019 19:03:32 -0700
+Subject: [PATCH] Fix #453 bad aspect ratio computed resulting in black.
+
+This occured when the s, width, or height properties are supplied with
+no "aspect."
+---
+ src/modules/avformat/consumer_avformat.c | 34 +++++++++++++-----------
+ 1 file changed, 18 insertions(+), 16 deletions(-)
+
+diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c
+index 738f5a972..dd2719997 100644
+--- a/src/modules/avformat/consumer_avformat.c
++++ b/src/modules/avformat/consumer_avformat.c
+@@ -271,22 +271,24 @@ mlt_consumer consumer_avformat_init( mlt_profile profile, char *arg )
+ static void recompute_aspect_ratio( mlt_properties properties )
+ {
+ double ar = mlt_properties_get_double( properties, "aspect" );
+- AVRational rational = av_d2q( ar, 255 );
+- int width = mlt_properties_get_int( properties, "width" );
+- int height = mlt_properties_get_int( properties, "height" );
+-
+- // Update the profile and properties as well since this is an alias
+- // for mlt properties that correspond to profile settings
+- mlt_properties_set_int( properties, "display_aspect_num", rational.num );
+- mlt_properties_set_int( properties, "display_aspect_den", rational.den );
+-
+- // Now compute the sample aspect ratio
+- rational = av_d2q( ar * height / FFMAX(width, 1), 255 );
+-
+- // Update the profile and properties as well since this is an alias
+- // for mlt properties that correspond to profile settings
+- mlt_properties_set_int( properties, "sample_aspect_num", rational.num );
+- mlt_properties_set_int( properties, "sample_aspect_den", rational.den );
++ if (ar > 0.0) {
++ AVRational rational = av_d2q( ar, 255 );
++ int width = mlt_properties_get_int( properties, "width" );
++ int height = mlt_properties_get_int( properties, "height" );
++
++ // Update the profile and properties as well since this is an alias
++ // for mlt properties that correspond to profile settings
++ mlt_properties_set_int( properties, "display_aspect_num", rational.num );
++ mlt_properties_set_int( properties, "display_aspect_den", rational.den );
++
++ // Now compute the sample aspect ratio
++ rational = av_d2q( ar * height / FFMAX(width, 1), 255 );
++
++ // Update the profile and properties as well since this is an alias
++ // for mlt properties that correspond to profile settings
++ mlt_properties_set_int( properties, "sample_aspect_num", rational.num );
++ mlt_properties_set_int( properties, "sample_aspect_den", rational.den );
++ }
+ }
+
+ static void color_trc_from_colorspace( mlt_properties properties )