X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffmpeg.c;h=9f29eac7b1673480771dc4d0b099515050f27167;hb=9aabe6678147d947ce7a32bf9bb1e087fac7fdde;hp=b44401f6705d8e14ee51b222675e8d05742a2ce9;hpb=4c592c39087a15e2b37aa46956775b7fa869fa57;p=ffmpeg diff --git a/ffmpeg.c b/ffmpeg.c index b44401f6705..9f29eac7b16 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -819,6 +819,10 @@ static void do_subtitle_out(AVFormatContext *s, if (!subtitle_out) { subtitle_out = av_malloc(subtitle_out_max_size); + if (!subtitle_out) { + av_log(NULL, AV_LOG_FATAL, "Failed to allocate subtitle_out\n"); + exit_program(1); + } } /* Note: DVB subtitle need one packet to draw them and one other @@ -1018,10 +1022,8 @@ static void do_video_out(AVFormatContext *s, /* raw pictures are written as AVPicture structure to avoid any copies. We support temporarily the older method. */ - mux_enc->coded_frame->interlaced_frame = in_picture->interlaced_frame; - mux_enc->coded_frame->top_field_first = in_picture->top_field_first; - if (mux_enc->coded_frame->interlaced_frame) - mux_enc->field_order = mux_enc->coded_frame->top_field_first ? AV_FIELD_TB:AV_FIELD_BT; + if (in_picture->interlaced_frame) + mux_enc->field_order = in_picture->top_field_first ? AV_FIELD_TB:AV_FIELD_BT; else mux_enc->field_order = AV_FIELD_PROGRESSIVE; pkt.data = (uint8_t *)in_picture; @@ -2742,6 +2744,7 @@ static int transcode_init(void) sar = dec_ctx->sample_aspect_ratio; ost->st->sample_aspect_ratio = enc_ctx->sample_aspect_ratio = sar; ost->st->avg_frame_rate = ist->st->avg_frame_rate; + ost->st->r_frame_rate = ist->st->r_frame_rate; break; case AVMEDIA_TYPE_SUBTITLE: enc_ctx->width = dec_ctx->width;