mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-16 01:03:16 -05:00
[transcode] Don't push NULL frames to filtergraph when flushing, can lead to segfault
This commit is contained in:
parent
ac3d47430c
commit
7894a4d85f
@ -373,11 +373,14 @@ filter_encode_write_frame(struct encode_ctx *ctx, AVFrame *frame, unsigned int s
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
// Push the decoded frame into the filtergraph
|
// Push the decoded frame into the filtergraph
|
||||||
ret = av_buffersrc_add_frame_flags(ctx->filter_ctx[stream_index].buffersrc_ctx, frame, 0);
|
if (frame)
|
||||||
if (ret < 0)
|
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_XCODE, "Error while feeding the filtergraph\n");
|
ret = av_buffersrc_add_frame_flags(ctx->filter_ctx[stream_index].buffersrc_ctx, frame, 0);
|
||||||
return -1;
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
DPRINTF(E_LOG, L_XCODE, "Error while feeding the filtergraph\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pull filtered frames from the filtergraph
|
// Pull filtered frames from the filtergraph
|
||||||
@ -424,11 +427,14 @@ filter_encode_write_frame(struct encode_ctx *ctx, AVFrame *frame, unsigned int s
|
|||||||
enc_ctx = ctx->ofmt_ctx->streams[stream_index]->codec;
|
enc_ctx = ctx->ofmt_ctx->streams[stream_index]->codec;
|
||||||
|
|
||||||
// Push the decoded frame into the filtergraph
|
// Push the decoded frame into the filtergraph
|
||||||
ret = av_buffersrc_write_frame(ctx->filter_ctx[stream_index].buffersrc_ctx, frame);
|
if (frame)
|
||||||
if (ret < 0)
|
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_XCODE, "Error while feeding the filtergraph\n");
|
ret = av_buffersrc_write_frame(ctx->filter_ctx[stream_index].buffersrc_ctx, frame);
|
||||||
return -1;
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
DPRINTF(E_LOG, L_XCODE, "Error while feeding the filtergraph\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pull filtered frames from the filtergraph
|
// Pull filtered frames from the filtergraph
|
||||||
|
Loading…
x
Reference in New Issue
Block a user