diff options
author | Nicolas Frattaroli <ffmpeg@fratti.ch> | 2017-11-02 23:39:53 +0100 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-11-03 00:26:26 -0300 |
commit | 1c06a32cfa5798332c1c879834a831e1e12c6f53 (patch) | |
tree | 6ca8b49c51eeb99b20ef30ba81dfa319f3ad233f /libavcodec | |
parent | 2805c8dcfc3b7d3701a72cef06af5e477c6c0cdb (diff) | |
download | ffmpeg-1c06a32cfa5798332c1c879834a831e1e12c6f53.tar.gz |
diracdec: fix deprecated API usage
avcodec_get_chroma_sub_sample is deprecated and generates a warning
during build, so av_pix_fmt_get_chroma_sub_sample is used
Signed-off-by: Nicolas Frattaroli <ffmpeg@fratti.ch>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/diracdec.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 0abb8b0599..7157357d59 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -26,6 +26,7 @@ * @author Marco Gerards <marco@gnu.org>, David Conrad, Jordi Ortiz <nenjordi@gmail.com> */ +#include "libavutil/pixdesc.h" #include "libavutil/thread.h" #include "avcodec.h" #include "get_bits.h" @@ -1927,7 +1928,10 @@ static int get_buffer_with_edge(AVCodecContext *avctx, AVFrame *f, int flags) { int ret, i; int chroma_x_shift, chroma_y_shift; - avcodec_get_chroma_sub_sample(avctx->pix_fmt, &chroma_x_shift, &chroma_y_shift); + ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &chroma_x_shift, + &chroma_y_shift); + if (ret < 0) + return ret; f->width = avctx->width + 2 * EDGE_WIDTH; f->height = avctx->height + 2 * EDGE_WIDTH + 2; @@ -2126,7 +2130,11 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int s->pshift = s->bit_depth > 8; - avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_x_shift, &s->chroma_y_shift); + ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, + &s->chroma_x_shift, + &s->chroma_y_shift); + if (ret < 0) + return ret; ret = alloc_sequence_buffers(s); if (ret < 0) |