Skip to content

Commit a4f84ef

Browse files
committed
libavcodec
1 parent 418c60e commit a4f84ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pens/main/gdpen.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static AVCodecContext *codec_ctx = NULL;
6666
static AVFrame *mpeg_frame = NULL;
6767
#if LIBAVCODEC_VERSION_MAJOR >= 54
6868
static AVPacket mpeg_pkt;
69+
static *AVPacket mpeg_pnt = NULL;
6970
static int mpeg_gout;
7071
#else
7172
static int frame_out_size;
@@ -537,7 +538,8 @@ static void ffmpeg_write (void) {
537538
if (avcodec_encode_video2 (codec_ctx, &mpeg_pkt, mpeg_frame, &mpeg_gout) < 0)
538539
ERR (FATAL, name, "MPEG encoding error\n");
539540
#else
540-
mpeg_pkt = av_packet_alloc();
541+
mpeg_pnt = av_packet_alloc();
542+
mpeg_pkt = *mpeg_pnt;
541543
mpeg_pkt.data = NULL;
542544
mpeg_pkt.size = 0;
543545
if (avcodec_send_frame(codec_ctx, mpeg_frame) < 0)

0 commit comments

Comments
 (0)