diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2012-06-30 21:33:48 +0200 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-06-30 21:44:25 +0200 |
commit | be24f85176d8e46c3154f1f51013f235b273183e (patch) | |
tree | 7a35aa2b686be3d6d1a6e95e1e6eaec193853a58 /ffmpeg.c | |
parent | 51d25783488c056b2323041eba2f54a9b6e932b7 (diff) | |
download | ffmpeg-be24f85176d8e46c3154f1f51013f235b273183e.tar.gz |
ffmpeg: re-set frame_size after filter graph reset.
The filter contexts are completely cleared,
so the frame size can not be kept.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -2425,10 +2425,20 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output) ist->resample_channels = avctx->channels; for (i = 0; i < nb_filtergraphs; i++) - if (ist_in_filtergraph(filtergraphs[i], ist) && - configure_filtergraph(filtergraphs[i]) < 0) { - av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\n"); - exit_program(1); + if (ist_in_filtergraph(filtergraphs[i], ist)) { + FilterGraph *fg = filtergraphs[i]; + int j; + if (configure_filtergraph(fg) < 0) { + av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\n"); + 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); + } } } |