mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-22 11:35:43 -04:00
[xcode] Fix last seconds being skipped when custom filters enabled
Seems EOF was not marked towards the ffmpeg filtergraph via a NULL frame to av_buffersrc_add_frame(). This meant that the end of the track would get stuck in the filters. Fixes #1787
This commit is contained in:
parent
297de1409a
commit
d672332750
@ -839,16 +839,15 @@ filter_encode_write(struct encode_ctx *ctx, struct stream_ctx *s, AVFrame *frame
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
// Push the decoded frame into the filtergraph
|
// Push the decoded frame into the filtergraph. If frame is NULL then it
|
||||||
if (frame)
|
// signals EOF to ffmpeg which is necessary to make av_buffersink_get_frame
|
||||||
{
|
// return the last frames (see issue #1787)
|
||||||
ret = av_buffersrc_add_frame(s->buffersrc_ctx, frame);
|
ret = av_buffersrc_add_frame(s->buffersrc_ctx, frame);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_XCODE, "Error while feeding the filtergraph: %s\n", err2str(ret));
|
DPRINTF(E_LOG, L_XCODE, "Error while feeding the filtergraph: %s\n", err2str(ret));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Pull filtered frames from the filtergraph and pass to encoder
|
// Pull filtered frames from the filtergraph and pass to encoder
|
||||||
while (1)
|
while (1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user