==FFMPEG==
Bugfixes: If we got problems on open, don't close a codec context, that was never created. (read: don't dump core ;-)
This commit is contained in:
@@ -537,7 +537,7 @@ void start_ffmpeg_impl(RenderData *rd, int rectx, int recty)
|
||||
|
||||
of->preload = (int)(0.5*AV_TIME_BASE);
|
||||
of->max_delay = (int)(0.7*AV_TIME_BASE);
|
||||
|
||||
|
||||
snprintf(of->filename, sizeof(of->filename), "%s", name);
|
||||
/* set the codec to the user's selection */
|
||||
switch(ffmpeg_type) {
|
||||
|
||||
@@ -558,7 +558,6 @@ static int startffmpeg(struct anim * anim) {
|
||||
/* Find the decoder for the video stream */
|
||||
pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
|
||||
if(pCodec==NULL) {
|
||||
avcodec_close(pCodecCtx);
|
||||
av_close_input_file(pFormatCtx);
|
||||
return -1;
|
||||
}
|
||||
@@ -575,7 +574,6 @@ static int startffmpeg(struct anim * anim) {
|
||||
pCodecCtx->error_concealment= 3;
|
||||
|
||||
if(avcodec_open(pCodecCtx, pCodec)<0) {
|
||||
avcodec_close(pCodecCtx);
|
||||
av_close_input_file(pFormatCtx);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -140,13 +140,11 @@ struct hdaudio * sound_open_hdaudio(char * filename)
|
||||
/* Find the decoder for the audio stream */
|
||||
pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
|
||||
if(pCodec == NULL) {
|
||||
avcodec_close(pCodecCtx);
|
||||
av_close_input_file(pFormatCtx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(avcodec_open(pCodecCtx, pCodec)<0) {
|
||||
avcodec_close(pCodecCtx);
|
||||
av_close_input_file(pFormatCtx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user