X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=libavcodec%2Fdxa.c;h=c06ab85cc79b293bee55e7740c7928a36ff7d5bb;hb=7817ddabc8ccb417c293c3c788dcbc6b225840b4;hp=b4b6f9379a6d5360cf9a0c42bfa5cc61c6809f19;hpb=2029f312e8c13b25d322d69961b42db2e66f616a;p=ffmpeg diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index b4b6f9379a6..c06ab85cc79 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -17,17 +17,17 @@ * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * */ /** - * @file dxa.c + * @file libavcodec/dxa.c * DXA Video decoder */ #include #include +#include "libavutil/intreadwrite.h" #include "avcodec.h" #include @@ -188,8 +188,10 @@ static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t* dst, uint return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) +static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; DxaDecContext * const c = avctx->priv_data; uint8_t *outptr, *srcptr, *tmpptr; unsigned long dsize; @@ -286,17 +288,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8 return orig_buf_size; } -static int decode_init(AVCodecContext *avctx) +static av_cold int decode_init(AVCodecContext *avctx) { DxaDecContext * const c = avctx->priv_data; c->avctx = avctx; avctx->pix_fmt = PIX_FMT_PAL8; - if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) { - return -1; - } - c->dsize = avctx->width * avctx->height * 2; if((c->decomp_buf = av_malloc(c->dsize)) == NULL) { av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n"); @@ -306,7 +304,7 @@ static int decode_init(AVCodecContext *avctx) return 0; } -static int decode_end(AVCodecContext *avctx) +static av_cold int decode_end(AVCodecContext *avctx) { DxaDecContext * const c = avctx->priv_data; @@ -327,6 +325,8 @@ AVCodec dxa_decoder = { decode_init, NULL, decode_end, - decode_frame + decode_frame, + CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("Feeble Files/ScummVM DXA"), };