]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/txd.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / txd.c
index a3cbde5f0b495c3cd06d3ac9ce168d0a461db122..4299636f7bf0f133a48e1dfd07cb7aae1826f2fb 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include "libavutil/intreadwrite.h"
+#include "libavutil/imgutils.h"
 #include "avcodec.h"
 #include "s3tc.h"
 
@@ -79,7 +80,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     if (p->data[0])
         avctx->release_buffer(avctx, p);
 
-    if (avcodec_check_dimensions(avctx, w, h))
+    if (av_image_check_size(w, h, 0, avctx))
         return -1;
     if (w != avctx->width || h != avctx->height)
         avcodec_set_dimensions(avctx, w, h);
@@ -88,7 +89,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
         return -1;
     }
 
-    p->pict_type = FF_I_TYPE;
+    p->pict_type = AV_PICTURE_TYPE_I;
 
     ptr    = p->data[0];
     stride = p->linesize[0];
@@ -154,16 +155,14 @@ static av_cold int txd_end(AVCodecContext *avctx) {
     return 0;
 }
 
-AVCodec txd_decoder = {
-    "txd",
-    CODEC_TYPE_VIDEO,
-    CODEC_ID_TXD,
-    sizeof(TXDContext),
-    txd_init,
-    NULL,
-    txd_end,
-    txd_decode_frame,
-    0,
-    NULL,
+AVCodec ff_txd_decoder = {
+    .name           = "txd",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_TXD,
+    .priv_data_size = sizeof(TXDContext),
+    .init           = txd_init,
+    .close          = txd_end,
+    .decode         = txd_decode_frame,
+    .capabilities   = CODEC_CAP_DR1,
     .long_name = NULL_IF_CONFIG_SMALL("Renderware TXD (TeXture Dictionary) image"),
 };