Re: [libav-devel] [PATCH 30/50] mjpegdec: stop using deprecated avcodec_set_dimensions

2013-10-28 Thread Justin Ruggles

On 10/27/2013 06:10 AM, Anton Khirnov wrote:

---
  libavcodec/mjpegdec.c |6 --
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index fdf7c87..dea195b 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -211,7 +211,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
  
  int ff_mjpeg_decode_sof(MJpegDecodeContext *s)

  {
-int len, nb_components, i, width, height, pix_fmt_id;
+int len, nb_components, i, width, height, pix_fmt_id, ret;
  
  /* XXX: verify len field validity */

  len = get_bits(&s->gb, 16);
@@ -309,7 +309,9 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
  height *= 2;
  }
  
-avcodec_set_dimensions(s->avctx, width, height);

+ret = ff_set_dimensions(s->avctx, width, height);
+if (ret < 0)
+return ret;
  
  s->first_picture = 0;

  }


Ok

-Justin

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 30/50] mjpegdec: stop using deprecated avcodec_set_dimensions

2013-10-27 Thread Anton Khirnov
---
 libavcodec/mjpegdec.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index fdf7c87..dea195b 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -211,7 +211,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
 
 int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 {
-int len, nb_components, i, width, height, pix_fmt_id;
+int len, nb_components, i, width, height, pix_fmt_id, ret;
 
 /* XXX: verify len field validity */
 len = get_bits(&s->gb, 16);
@@ -309,7 +309,9 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 height *= 2;
 }
 
-avcodec_set_dimensions(s->avctx, width, height);
+ret = ff_set_dimensions(s->avctx, width, height);
+if (ret < 0)
+return ret;
 
 s->first_picture = 0;
 }
-- 
1.7.10.4

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel