]> git.sesse.net Git - vlc/commitdiff
* forwardport the mjpeg fix and the dvbsub color fixes
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 2 Nov 2006 20:23:57 +0000 (20:23 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 2 Nov 2006 20:23:57 +0000 (20:23 +0000)
modules/codec/dvbsub.c
modules/demux/mjpeg.c

index 96d337d7f5095425df0605b2f92c0eae54eae545..16010d05240e55750cacd4a24869d50b59ac4917 100644 (file)
@@ -419,8 +419,8 @@ static void default_clut_init( decoder_t *p_dec )
         else R = G = B = 0x7F;
 
         p_sys->default_clut.c_2b[i].Y = RGB_TO_Y(R,G,B);
-        p_sys->default_clut.c_2b[i].Cr = RGB_TO_U(R,G,B);
         p_sys->default_clut.c_2b[i].Cb = RGB_TO_V(R,G,B);
+        p_sys->default_clut.c_2b[i].Cr = RGB_TO_U(R,G,B);
         p_sys->default_clut.c_2b[i].T = T;
     }
 
@@ -450,8 +450,8 @@ static void default_clut_init( decoder_t *p_dec )
         }
 
         p_sys->default_clut.c_4b[i].Y = RGB_TO_Y(R,G,B);
-        p_sys->default_clut.c_4b[i].Cr = RGB_TO_U(R,G,B);
-        p_sys->default_clut.c_4b[i].Cb = RGB_TO_V(R,G,B);
+        p_sys->default_clut.c_4b[i].Cr = RGB_TO_V(R,G,B);
+        p_sys->default_clut.c_4b[i].Cb = RGB_TO_U(R,G,B);
         p_sys->default_clut.c_4b[i].T = T;
     }
 
@@ -1405,8 +1405,8 @@ static subpicture_t *render( decoder_t *p_dec )
         for( j = 0; j < fmt.p_palette->i_entries; j++ )
         {
             fmt.p_palette->palette[j][0] = p_color[j].Y;
-            fmt.p_palette->palette[j][1] = p_color[j].Cr;
-            fmt.p_palette->palette[j][2] = p_color[j].Cb;
+            fmt.p_palette->palette[j][1] = p_color[j].Cb; /* U == Cb */
+            fmt.p_palette->palette[j][2] = p_color[j].Cr; /* V == Cr */
             fmt.p_palette->palette[j][3] = 0xff - p_color[j].T;
         }
 
@@ -1464,6 +1464,8 @@ static subpicture_t *render( decoder_t *p_dec )
     p_spu->i_flags = p_sys->i_spu_position;
     p_spu->i_x = p_sys->i_spu_x;
     p_spu->i_y = p_sys->i_spu_y;
+    p_spu->i_original_picture_width = 720;
+    p_spu->i_original_picture_height = 576;
 
     return p_spu;
 }
index 67824c98027dff6174f5ea4508b0da810b99e7cd..054f7a9ac803f3ceaf3c7cf7519e9c8ee03f675c 100644 (file)
@@ -202,7 +202,9 @@ static vlc_bool_t CheckMimeHeader( demux_t *p_demux, int *p_header_size )
         *p_header_size = -3;
         return VLC_FALSE;
     }
-    if( NULL == p_sys->psz_separator )
+
+    /* Read the separator and remember it if not yet stored */
+    if( p_sys->psz_separator == NULL )
     {
         p_sys->psz_separator = psz_line;
         msg_Dbg( p_demux, "Multipart MIME detected, using separator: %s",
@@ -215,8 +217,9 @@ static vlc_bool_t CheckMimeHeader( demux_t *p_demux, int *p_header_size )
             msg_Warn( p_demux, "separator %s does not match %s", psz_line,
                       p_sys->psz_separator );
         }
+        free( psz_line );
     }
-    free( psz_line );
+
     psz_line = GetLine( p_demux, &i_pos );
     while( psz_line && *psz_line )
     {