diff options
author | Clément Bœsch <u@pkh.me> | 2017-03-21 14:44:44 +0100 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2017-03-21 14:44:44 +0100 |
commit | 5dfe343d96dcd2159cb9242304f1336cb0176d11 (patch) | |
tree | 0b6d7d74ba777816fd224209515518390a15cd37 | |
parent | ad98af27f7100a80fd5ff934ddc7e9aca94f0496 (diff) | |
parent | 7bf8db4db61eb09fac00eb665d8ec58de8817da6 (diff) | |
download | ffmpeg-5dfe343d96dcd2159cb9242304f1336cb0176d11.tar.gz |
Merge commit '7bf8db4db61eb09fac00eb665d8ec58de8817da6'
* commit '7bf8db4db61eb09fac00eb665d8ec58de8817da6':
tdsc: use the new decoding API
Merged-by: Clément Bœsch <u@pkh.me>
-rw-r--r-- | libavcodec/tdsc.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libavcodec/tdsc.c b/libavcodec/tdsc.c index 8460568d7d..4182404cf0 100644 --- a/libavcodec/tdsc.c +++ b/libavcodec/tdsc.c @@ -343,7 +343,6 @@ static int tdsc_decode_jpeg_tile(AVCodecContext *avctx, int tile_size, { TDSCContext *ctx = avctx->priv_data; AVPacket jpkt; - int got_frame = 0; int ret; /* Prepare a packet and send to the MJPEG decoder */ @@ -351,12 +350,16 @@ static int tdsc_decode_jpeg_tile(AVCodecContext *avctx, int tile_size, jpkt.data = ctx->tilebuffer; jpkt.size = tile_size; - ret = avcodec_decode_video2(ctx->jpeg_avctx, ctx->jpgframe, - &got_frame, &jpkt); - if (ret < 0 || !got_frame || ctx->jpgframe->format != AV_PIX_FMT_YUVJ420P) { + ret = avcodec_send_packet(ctx->jpeg_avctx, &jpkt); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "Error submitting a packet for decoding\n"); + return ret; + } + + ret = avcodec_receive_frame(ctx->jpeg_avctx, ctx->jpgframe); + if (ret < 0 || ctx->jpgframe->format != AV_PIX_FMT_YUVJ420P) { av_log(avctx, AV_LOG_ERROR, - "JPEG decoding error (%d) for (%d) frame.\n", - ret, got_frame); + "JPEG decoding error (%d).\n", ret); /* Normally skip, error if explode */ if (avctx->err_recognition & AV_EF_EXPLODE) |