[vlc-devel] [PATCH] Properly fix HDTV height for H.264 streams

Marian Ďurkovič md at bts.sk
Fri Oct 3 12:14:17 CEST 2008


Hi,

  attached please find the patch which ensures proper fixing for
broken H.264 HDTV-1080 streams. Unfortunately, even with H.264,
some broadcasters still transmit 1088 lines :-(

   With kind regards,

         M.


diff --git a/src/input/decoder.c b/src/input/decoder.c
index 0e30948..1d6aa9c 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1303,8 +1303,10 @@ static picture_t *vout_new_buffer( decoder_t *p_dec )
             var_CreateGetBool( p_dec, "hdtv-fix" ) )
         {
             p_dec->fmt_out.video.i_visible_height = 1080;
-            p_dec->fmt_out.video.i_sar_num *= 135;
-            p_dec->fmt_out.video.i_sar_den *= 136;
+            if( !(p_dec->fmt_out.video.i_sar_num % 136)) {
+                p_dec->fmt_out.video.i_sar_num *= 135;
+                p_dec->fmt_out.video.i_sar_den *= 136;
+            }
             msg_Warn( p_dec, "Fixing broken HDTV stream
(display_height=1088)")
         }




More information about the vlc-devel mailing list