[vlc-commits] demux: mkv: fix the DisplayUnit log for DAR and unknown values

Steve Lhomme git at videolan.org
Fri Jan 19 12:01:48 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jan 19 09:16:51 2018 +0100| [213a1508b167b6307b5336cf7010a9080ea65c10] | committer: Jean-Baptiste Kempf

demux: mkv: fix the DisplayUnit log for DAR and unknown values

(cherry picked from commit faa273ee1073ecf695c758074441df3cf98d67f6)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=213a1508b167b6307b5336cf7010a9080ea65c10
---

 modules/demux/mkv/matroska_segment_parse.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index aba61b06d5..c7e4193060 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -601,8 +601,16 @@ void matroska_segment_c::ParseTrackEntry( const KaxTrackEntry *m )
         E_CASE( KaxVideoDisplayUnit, vdmode )
         {
             vars.track_video_info.i_display_unit = static_cast<uint8>( vdmode );
-            debug( vars, "Track Video Display Unit=%s",
-                vars.track_video_info.i_display_unit == 0 ? "pixels" : ( vars.track_video_info.i_display_unit == 1 ? "centimeters": "inches" ) );
+            const char *psz_unit;
+            switch (vars.track_video_info.i_display_unit)
+            {
+            case 0:  psz_unit = "pixels"; break;
+            case 1:  psz_unit = "centimeters"; break;
+            case 2:  psz_unit = "inches"; break;
+            case 3:  psz_unit = "dar"; break;
+            default: psz_unit = "unknown"; break;
+            }
+            debug( vars, "Track Video Display Unit=%s", psz_unit );
         }
         E_CASE( KaxVideoAspectRatio, ratio ) // UNUSED
         {



More information about the vlc-commits mailing list