[vlc-commits] avcodec: video: fix comparing signed/unsigned resolutions

Ilkka Ollakka git at videolan.org
Wed Sep 7 11:16:44 CEST 2016


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Sep  4 11:51:49 2016 +0300| [718f7a97b3520e3a9d614aa31e9ab49b9751d4eb] | committer: Ilkka Ollakka

avcodec: video: fix comparing signed/unsigned resolutions

Cleared up the comparision as it was actually just comparing if
visible_width is different to width, with few extra steps taken previously.

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

 modules/codec/avcodec/video.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index f610942..b2f513e 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -338,14 +338,10 @@ static int OpenVideoCodec( decoder_t *p_dec )
 
     p_sys->p_context->width  = p_dec->fmt_in.video.i_visible_width;
     p_sys->p_context->height = p_dec->fmt_in.video.i_visible_height;
-    if (p_sys->p_context->width  == 0)
-        p_sys->p_context->width  = p_dec->fmt_in.video.i_width;
-    else if (p_sys->p_context->width != p_dec->fmt_in.video.i_width)
-        p_sys->p_context->coded_width = p_dec->fmt_in.video.i_width;
-    if (p_sys->p_context->height == 0)
-        p_sys->p_context->height = p_dec->fmt_in.video.i_height;
-    else if (p_sys->p_context->height != p_dec->fmt_in.video.i_height)
-        p_sys->p_context->coded_height = p_dec->fmt_in.video.i_height;
+
+    p_sys->p_context->coded_width = p_dec->fmt_in.video.i_width;
+    p_sys->p_context->coded_height = p_dec->fmt_in.video.i_height;
+
     p_sys->p_context->bits_per_coded_sample = p_dec->fmt_in.video.i_bits_per_pixel;
     p_sys->pix_fmt = AV_PIX_FMT_NONE;
     p_sys->profile = -1;



More information about the vlc-commits mailing list