]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dpx.c
vda: merge implementation into one file.
[ffmpeg] / libavcodec / dpx.c
index 76a12aa9b3cd160392efb9379cfdb9a1113b6d85..5e350057769e27bf125397406fcf65fe33bd6cee 100644 (file)
@@ -62,7 +62,8 @@ static int decode_frame(AVCodecContext *avctx,
     AVFrame *const p = &s->picture;
     uint8_t *ptr;
 
-    int magic_num, offset, endian;
+    unsigned int offset;
+    int magic_num, endian;
     int x, y;
     int w, h, stride, bits_per_color, descriptor, elements, target_packet_size, source_packet_size;
 
@@ -114,7 +115,7 @@ static int decode_frame(AVCodecContext *avctx,
                    avctx->sample_aspect_ratio.num,  avctx->sample_aspect_ratio.den,
                   0x10000);
     else
-        avctx->sample_aspect_ratio = (AVRational){ 0, 0 };
+        avctx->sample_aspect_ratio = (AVRational){ 0, 1 };
 
     switch (descriptor) {
         case 51: // RGBA
@@ -242,10 +243,11 @@ static av_cold int decode_end(AVCodecContext *avctx)
 AVCodec ff_dpx_decoder = {
     .name           = "dpx",
     .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = CODEC_ID_DPX,
+    .id             = AV_CODEC_ID_DPX,
     .priv_data_size = sizeof(DPXContext),
     .init           = decode_init,
     .close          = decode_end,
     .decode         = decode_frame,
+    .capabilities   = CODEC_CAP_DR1,
     .long_name      = NULL_IF_CONFIG_SMALL("DPX image"),
 };