Fixed RGB ffmpeg color selection.
[vlc.git] / modules / codec / png.c
index bac19f5..7ed1c03 100644 (file)
@@ -182,6 +182,9 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     p_dec->fmt_out.video.i_width = i_width;
     p_dec->fmt_out.video.i_height = i_height;
     p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * i_width / i_height;
+    p_dec->fmt_out.video.i_rmask = 0x000000ff;
+    p_dec->fmt_out.video.i_gmask = 0x0000ff00;
+    p_dec->fmt_out.video.i_bmask = 0x00ff0000;
 
     if( i_color_type == PNG_COLOR_TYPE_PALETTE )
         png_set_palette_to_rgb( p_png );
@@ -201,12 +204,6 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     {
         p_dec->fmt_out.i_codec = VLC_FOURCC('R','V','2','4');
     }
-    if( i_color_type & PNG_COLOR_MASK_COLOR &&
-        p_dec->fmt_out.i_codec != VLC_FOURCC('R','V','2','4') )
-    {
-        /* Invert colors */
-        png_set_bgr( p_png );
-    }
 
     /* Get a new picture */
     p_pic = p_dec->pf_vout_buffer_new( p_dec );