mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-24 03:59:43 +00:00
tdsc: use the new decoding API
This commit is contained in:
parent
de2ae3c1fa
commit
7bf8db4db6
@ -343,7 +343,6 @@ static int tdsc_decode_jpeg_tile(AVCodecContext *avctx, int tile_size,
|
|||||||
{
|
{
|
||||||
TDSCContext *ctx = avctx->priv_data;
|
TDSCContext *ctx = avctx->priv_data;
|
||||||
AVPacket jpkt;
|
AVPacket jpkt;
|
||||||
int got_frame = 0;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Prepare a packet and send to the MJPEG decoder */
|
/* 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.data = ctx->tilebuffer;
|
||||||
jpkt.size = tile_size;
|
jpkt.size = tile_size;
|
||||||
|
|
||||||
ret = avcodec_decode_video2(ctx->jpeg_avctx, ctx->jpgframe,
|
ret = avcodec_send_packet(ctx->jpeg_avctx, &jpkt);
|
||||||
&got_frame, &jpkt);
|
if (ret < 0) {
|
||||||
if (ret < 0 || !got_frame || ctx->jpgframe->format != AV_PIX_FMT_YUVJ420P) {
|
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,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"JPEG decoding error (%d) for (%d) frame.\n",
|
"JPEG decoding error (%d).\n", ret);
|
||||||
ret, got_frame);
|
|
||||||
|
|
||||||
/* Normally skip, error if explode */
|
/* Normally skip, error if explode */
|
||||||
if (avctx->err_recognition & AV_EF_EXPLODE)
|
if (avctx->err_recognition & AV_EF_EXPLODE)
|
||||||
|
Loading…
Reference in New Issue
Block a user