mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-09 00:29:54 +00:00
ffmpeg: re-set frame_size after filter graph reset.
The filter contexts are completely cleared, so the frame size can not be kept.
This commit is contained in:
parent
51d2578348
commit
be24f85176
14
ffmpeg.c
14
ffmpeg.c
@ -2425,11 +2425,21 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
|
|||||||
ist->resample_channels = avctx->channels;
|
ist->resample_channels = avctx->channels;
|
||||||
|
|
||||||
for (i = 0; i < nb_filtergraphs; i++)
|
for (i = 0; i < nb_filtergraphs; i++)
|
||||||
if (ist_in_filtergraph(filtergraphs[i], ist) &&
|
if (ist_in_filtergraph(filtergraphs[i], ist)) {
|
||||||
configure_filtergraph(filtergraphs[i]) < 0) {
|
FilterGraph *fg = filtergraphs[i];
|
||||||
|
int j;
|
||||||
|
if (configure_filtergraph(fg) < 0) {
|
||||||
av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\n");
|
av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\n");
|
||||||
exit_program(1);
|
exit_program(1);
|
||||||
}
|
}
|
||||||
|
for (j = 0; j < fg->nb_outputs; j++) {
|
||||||
|
OutputStream *ost = fg->outputs[j]->ost;
|
||||||
|
if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
|
||||||
|
!(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
|
||||||
|
av_buffersink_set_frame_size(ost->filter->filter,
|
||||||
|
ost->st->codec->frame_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < ist->nb_filters; i++)
|
for (i = 0; i < ist->nb_filters; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user