Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2021-05-28 19:35:26 +0300
committerJeroen Bakker <jeroen@blender.org>2021-06-30 10:32:45 +0300
commitfe4cbe62dff28933d6b5b66a2a9e95074016fd1e (patch)
treefee78c57937f5f590f30010afc400abd9f90203a /source/blender/imbuf/intern
parentf522e8db22883ede1469aaef45e917e817748369 (diff)
Fix T87932: Failure to build movie strip proxy
We didn't initialize the scaled proxy frame properly. This would lead to issues in ffmpeg 4.4 as they are more strict that the API is properly used. Now we initialize the size and format of the frame.
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r--source/blender/imbuf/intern/indexer.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c
index 11ce77e3091..26f332bd575 100644
--- a/source/blender/imbuf/intern/indexer.c
+++ b/source/blender/imbuf/intern/indexer.c
@@ -466,13 +466,6 @@ struct proxy_output_ctx {
struct anim *anim;
};
-// work around stupid swscaler 16 bytes alignment bug...
-
-static int round_up(int x, int mod)
-{
- return x + ((mod - (x % mod)) % mod);
-}
-
static struct proxy_output_ctx *alloc_proxy_output_ffmpeg(
struct anim *anim, AVStream *st, int proxy_size, int width, int height, int quality)
{
@@ -595,15 +588,19 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg(
if (st->codecpar->width != width || st->codecpar->height != height ||
st->codecpar->format != rv->c->pix_fmt) {
rv->frame = av_frame_alloc();
- av_image_fill_arrays(
- rv->frame->data,
- rv->frame->linesize,
- MEM_mallocN(av_image_get_buffer_size(rv->c->pix_fmt, round_up(width, 16), height, 1),
- "alloc proxy output frame"),
- rv->c->pix_fmt,
- round_up(width, 16),
- height,
- 1);
+
+ av_image_fill_arrays(rv->frame->data,
+ rv->frame->linesize,
+ MEM_mallocN(av_image_get_buffer_size(rv->c->pix_fmt, width, height, 1),
+ "alloc proxy output frame"),
+ rv->c->pix_fmt,
+ width,
+ height,
+ 1);
+
+ rv->frame->format = rv->c->pix_fmt;
+ rv->frame->width = width;
+ rv->frame->height = height;
rv->sws_ctx = sws_getContext(st->codecpar->width,
rv->orig_height,