You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
avfilter/vf_alphamerge: configure correct alpha mode
This commit is contained in:
@@ -49,6 +49,7 @@ typedef struct AlphaMergeContext {
|
|||||||
static int do_alphamerge(FFFrameSync *fs)
|
static int do_alphamerge(FFFrameSync *fs)
|
||||||
{
|
{
|
||||||
AVFilterContext *ctx = fs->parent;
|
AVFilterContext *ctx = fs->parent;
|
||||||
|
AVFilterLink *outlink = ctx->outputs[0];
|
||||||
AlphaMergeContext *s = ctx->priv;
|
AlphaMergeContext *s = ctx->priv;
|
||||||
AVFrame *main_buf, *alpha_buf;
|
AVFrame *main_buf, *alpha_buf;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -56,6 +57,7 @@ static int do_alphamerge(FFFrameSync *fs)
|
|||||||
ret = ff_framesync_dualinput_get_writable(fs, &main_buf, &alpha_buf);
|
ret = ff_framesync_dualinput_get_writable(fs, &main_buf, &alpha_buf);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
main_buf->alpha_mode = outlink->alpha_mode;
|
||||||
if (!alpha_buf)
|
if (!alpha_buf)
|
||||||
return ff_filter_frame(ctx->outputs[0], main_buf);
|
return ff_filter_frame(ctx->outputs[0], main_buf);
|
||||||
|
|
||||||
@@ -118,6 +120,11 @@ static int query_formats(const AVFilterContext *ctx,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
ret = ff_formats_ref(ff_make_formats_list_singleton(AVALPHA_MODE_STRAIGHT),
|
||||||
|
&cfg_out[0]->alpha_modes);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user