mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
fftools/ffmpeg: Repair reinit_filter feature
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 35040048793bc5d19942277fe17d1235e915a7d8) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
2661025679
commit
3c4a874388
10
ffmpeg.c
10
ffmpeg.c
@ -2154,9 +2154,6 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame)
|
|||||||
|
|
||||||
/* determine if the parameters for this input changed */
|
/* determine if the parameters for this input changed */
|
||||||
need_reinit = ifilter->format != frame->format;
|
need_reinit = ifilter->format != frame->format;
|
||||||
if (!!ifilter->hw_frames_ctx != !!frame->hw_frames_ctx ||
|
|
||||||
(ifilter->hw_frames_ctx && ifilter->hw_frames_ctx->data != frame->hw_frames_ctx->data))
|
|
||||||
need_reinit = 1;
|
|
||||||
|
|
||||||
switch (ifilter->ist->st->codecpar->codec_type) {
|
switch (ifilter->ist->st->codecpar->codec_type) {
|
||||||
case AVMEDIA_TYPE_AUDIO:
|
case AVMEDIA_TYPE_AUDIO:
|
||||||
@ -2170,6 +2167,13 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ifilter->ist->reinit_filters && fg->graph)
|
||||||
|
need_reinit = 0;
|
||||||
|
|
||||||
|
if (!!ifilter->hw_frames_ctx != !!frame->hw_frames_ctx ||
|
||||||
|
(ifilter->hw_frames_ctx && ifilter->hw_frames_ctx->data != frame->hw_frames_ctx->data))
|
||||||
|
need_reinit = 1;
|
||||||
|
|
||||||
if (need_reinit) {
|
if (need_reinit) {
|
||||||
ret = ifilter_parameters_from_frame(ifilter, frame);
|
ret = ifilter_parameters_from_frame(ifilter, frame);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user