== FFMPEG / Canon DSLR footage workaround ==
[blender.git] / source / blender / imbuf / intern / indexer.c
index 002ffd409a2ca0ff21d5059d523f554289b5e3f9..780ca7e5769ae23ff2037441360e042793e6c2ec 100644 (file)
@@ -552,7 +552,7 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg(
        rv->video_buffer = (uint8_t *)MEM_mallocN(
                rv->video_buffersize, "FFMPEG video buffer");
 
-       rv->orig_height = st->codec->height;
+       rv->orig_height = av_get_cropped_height_from_codec(st->codec);
 
        if (st->codec->width != width || st->codec->height != height ||
            st->codec->pix_fmt != rv->c->pix_fmt)
@@ -567,7 +567,7 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg(
 
                rv->sws_ctx = sws_getContext(
                        st->codec->width,
-                       st->codec->height,
+                       rv->orig_height,
                        st->codec->pix_fmt,
                        width, height,
                        rv->c->pix_fmt,
@@ -809,7 +809,8 @@ static IndexBuildContext *index_ffmpeg_create_context(struct anim *anim, IMB_Tim
                        context->proxy_ctx[i] = alloc_proxy_output_ffmpeg(
                                anim, context->iStream, proxy_sizes[i],
                                context->iCodecCtx->width * proxy_fac[i],
-                               context->iCodecCtx->height * proxy_fac[i],
+                               av_get_cropped_height_from_codec(
+                                       context->iCodecCtx) * proxy_fac[i],
                                quality);
                        if (!context->proxy_ctx[i]) {
                                proxy_sizes_in_use &= ~proxy_sizes[i];