]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dpx.c
rtsp: Make the rtsp flags avoptions set via a define
[ffmpeg] / libavcodec / dpx.c
index 82891d6b42086bbd6b3d14244635770aeb703d05..156f1deaa49e4d33780adea6b2304c809ce98558 100644 (file)
@@ -68,7 +68,7 @@ static int decode_frame(AVCodecContext *avctx,
 
     unsigned int rgbBuffer;
 
-    if (avpkt->size <= 0x324) {
+    if (avpkt->size <= 1634) {
         av_log(avctx, AV_LOG_ERROR, "Packet too small for DPX header\n");
         return AVERROR_INVALIDDATA;
     }
@@ -106,6 +106,10 @@ static int decode_frame(AVCodecContext *avctx,
     avctx->bits_per_raw_sample =
     bits_per_color = buf[0];
 
+    buf += 825;
+    avctx->sample_aspect_ratio.num = read32(&buf, endian);
+    avctx->sample_aspect_ratio.den = read32(&buf, endian);
+
     switch (descriptor) {
         case 51: // RGBA
             elements = 4;
@@ -230,15 +234,12 @@ static av_cold int decode_end(AVCodecContext *avctx)
 }
 
 AVCodec ff_dpx_decoder = {
-    "dpx",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_DPX,
-    sizeof(DPXContext),
-    decode_init,
-    NULL,
-    decode_end,
-    decode_frame,
-    0,
-    NULL,
+    .name           = "dpx",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_DPX,
+    .priv_data_size = sizeof(DPXContext),
+    .init           = decode_init,
+    .close          = decode_end,
+    .decode         = decode_frame,
     .long_name = NULL_IF_CONFIG_SMALL("DPX image"),
 };