You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	ffmpeg: Do av_buffersink_set_frame_size() when reconfiguring the filtergraph not just when changing audio resample parameters
Fixes Ticket3562 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		
							
								
								
									
										8
									
								
								ffmpeg.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								ffmpeg.c
									
									
									
									
									
								
							| @@ -1821,18 +1821,10 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output) | ||||
|         for (i = 0; i < nb_filtergraphs; i++) | ||||
|             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->enc_ctx->frame_size); | ||||
|                 } | ||||
|             } | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -928,6 +928,16 @@ int configure_filtergraph(FilterGraph *fg) | ||||
|     } | ||||
|  | ||||
|     fg->reconfiguration = 1; | ||||
|  | ||||
|     for (i = 0; i < fg->nb_outputs; i++) { | ||||
|         OutputStream *ost = fg->outputs[i]->ost; | ||||
|         if (ost && | ||||
|             ost->enc->type == AVMEDIA_TYPE_AUDIO && | ||||
|             !(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)) | ||||
|             av_buffersink_set_frame_size(ost->filter->filter, | ||||
|                                          ost->enc_ctx->frame_size); | ||||
|     } | ||||
|  | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user