[vlc-devel] [PATCH 2/2] decoder: update the output format when HDR10 metadata change

Steve Lhomme robux4 at videolabs.io
Thu Apr 6 17:42:41 CEST 2017


So that the es_out can be updated and known to the user.
---
 src/input/decoder.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index cc6f210505..5b4d5d6edc 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -496,6 +496,17 @@ static int vout_update_format( decoder_t *p_dec )
             return -1;
         }
     }
+
+    if ( p_dec->fmt_out.video.mastering.max_luminance !=
+         p_owner->fmt.video.mastering.max_luminance ||
+         p_dec->fmt_out.video.ligthing.MaxCLL !=
+         p_owner->fmt.video.ligthing.MaxCLL )
+    {
+        /* the format has changed but we don't need a new vout */
+        vlc_mutex_lock( &p_owner->lock );
+        DecoderUpdateFormatLocked( p_dec );
+        vlc_mutex_unlock( &p_owner->lock );
+    }
     return 0;
 }
 
-- 
2.11.1



More information about the vlc-devel mailing list