Fix x11 screen capture memory leakage

This commit is contained in:
dijunkun
2023-11-08 01:20:02 -08:00
parent 007134838b
commit 7409351b66
3 changed files with 8 additions and 6 deletions

View File

@@ -239,6 +239,7 @@ int main(int argc, char *argv[]) {
if (av_read_frame(pFormatCtx, packet) >= 0) {
if (packet->stream_index == videoindex) {
avcodec_send_packet(pCodecCtx, packet);
av_packet_unref(packet);
got_picture = avcodec_receive_frame(pCodecCtx, pFrame);
// ret = avcodec_decode_video2(pCodecCtx, pFrame, &got_picture,
// packet);