[vlc-commits] swscale: remove pointless code

Rémi Denis-Courmont git at videolan.org
Tue Apr 12 23:38:40 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr 13 00:35:57 2016 +0300| [3bdae973a0a8c37e3073d3eba83fb4ee188b0c13] | committer: Rémi Denis-Courmont

swscale: remove pointless code

The format of an input picture must always be equal to the input format
the conversion filter (by definition and by design). This code had no
effects.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3bdae973a0a8c37e3073d3eba83fb4ee188b0c13
---

 modules/video_chroma/swscale.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/modules/video_chroma/swscale.c b/modules/video_chroma/swscale.c
index f18017e..d0e3a9b 100644
--- a/modules/video_chroma/swscale.c
+++ b/modules/video_chroma/swscale.c
@@ -594,13 +594,9 @@ static void Convert( filter_t *p_filter, struct SwsContext *ctx,
                p_src, i_plane_count, b_swap_uvi );
     if( p_filter->fmt_in.video.i_chroma == VLC_CODEC_RGBP )
     {
-        video_palette_t *src_pal =
-            p_src->format.p_palette ?
-            p_src->format.p_palette :
-            p_filter->fmt_in.video.p_palette;
         memset( palette, 0, sizeof(palette) );
-        if( src_pal )
-            memcpy( palette, src_pal->palette,
+        if( p_filter->fmt_in.video.p_palette )
+            memcpy( palette, p_filter->fmt_in.video.p_palette->palette,
                     __MIN( sizeof(video_palette_t), AVPALETTE_SIZE ) );
         src[1] = palette;
         src_stride[1] = 4;



More information about the vlc-commits mailing list