File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -529,14 +529,17 @@ static void ffmpeg_write (void) {
529529 frame_out_size = avcodec_encode_video (codec_ctx , frame_outbuf ,
530530 frame_outbuf_size , mpeg_frame );
531531 fwrite (frame_outbuf , 1 , frame_out_size , pltout );
532- #else
532+ #else
533+ #if LIBAVCODEC_VERSION_MAJOR < 58
533534 av_init_packet (& mpeg_pkt );
534535 mpeg_pkt .data = NULL ;
535536 mpeg_pkt .size = 0 ;
536- #if LIBAVCODEC_VERSION_MAJOR < 58
537537 if (avcodec_encode_video2 (codec_ctx , & mpeg_pkt , mpeg_frame , & mpeg_gout ) < 0 )
538538 ERR (FATAL , name , "MPEG encoding error\n" );
539539#else
540+ mpeg_pkt = av_packet_alloc ();
541+ mpeg_pkt .data = NULL ;
542+ mpeg_pkt .size = 0 ;
540543 if (avcodec_send_frame (codec_ctx , mpeg_frame ) < 0 )
541544 ERR (FATAL , name , "MPEG send frame error\n" );
542545 mpeg_gout = avcodec_receive_packet (codec_ctx , & mpeg_pkt );
You can’t perform that action at this time.
0 commit comments