set defaults based on CodecType by using avcodec_get_context_defaults2()
Originally committed as revision 8285 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
		
							parent
							
								
									8e532e681e
								
							
						
					
					
						commit
						54cc9c46e6
					
				
							
								
								
									
										8
									
								
								ffmpeg.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								ffmpeg.c
									
									
									
									
									
								
							@ -2696,6 +2696,7 @@ static void new_video_stream(AVFormatContext *oc)
 | 
				
			|||||||
        fprintf(stderr, "Could not alloc stream\n");
 | 
					        fprintf(stderr, "Could not alloc stream\n");
 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    avcodec_get_context_defaults2(st->codec, CODEC_TYPE_VIDEO);
 | 
				
			||||||
    bitstream_filters[nb_output_files][oc->nb_streams - 1]= video_bitstream_filters;
 | 
					    bitstream_filters[nb_output_files][oc->nb_streams - 1]= video_bitstream_filters;
 | 
				
			||||||
    video_bitstream_filters= NULL;
 | 
					    video_bitstream_filters= NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -2854,6 +2855,7 @@ static void new_audio_stream(AVFormatContext *oc)
 | 
				
			|||||||
        fprintf(stderr, "Could not alloc stream\n");
 | 
					        fprintf(stderr, "Could not alloc stream\n");
 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
 | 
					    bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
 | 
				
			||||||
    audio_bitstream_filters= NULL;
 | 
					    audio_bitstream_filters= NULL;
 | 
				
			||||||
@ -2930,6 +2932,7 @@ static void opt_new_subtitle_stream(void)
 | 
				
			|||||||
        fprintf(stderr, "Could not alloc stream\n");
 | 
					        fprintf(stderr, "Could not alloc stream\n");
 | 
				
			||||||
        exit(1);
 | 
					        exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    avcodec_get_context_defaults2(st->codec, CODEC_TYPE_SUBTITLE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    subtitle_enc = st->codec;
 | 
					    subtitle_enc = st->codec;
 | 
				
			||||||
    subtitle_enc->codec_type = CODEC_TYPE_SUBTITLE;
 | 
					    subtitle_enc->codec_type = CODEC_TYPE_SUBTITLE;
 | 
				
			||||||
@ -3755,8 +3758,9 @@ int main(int argc, char **argv)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    av_register_all();
 | 
					    av_register_all();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for(i=0; i<CODEC_TYPE_NB; i++)
 | 
					    for(i=0; i<CODEC_TYPE_NB; i++){
 | 
				
			||||||
        avctx_opts[i]= avcodec_alloc_context();
 | 
					        avctx_opts[i]= avcodec_alloc_context2(i);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    avformat_opts = av_alloc_format_context();
 | 
					    avformat_opts = av_alloc_format_context();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (argc <= 1)
 | 
					    if (argc <= 1)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user