From e9096e3e342a1b510573be5b9c009c651db829b1 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 4 Jul 2021 12:19:52 +0200 Subject: [PATCH] Remove unnecessary calls to av_packet_unref() av_packet_free() already calls av_packet_unref(). --- app/src/recorder.c | 1 - app/src/stream.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/app/src/recorder.c b/app/src/recorder.c index 85570324..0cf87934 100644 --- a/app/src/recorder.c +++ b/app/src/recorder.c @@ -51,7 +51,6 @@ record_packet_new(const AVPacket *packet) { static void record_packet_delete(struct record_packet *rec) { - av_packet_unref(rec->packet); av_packet_free(&rec->packet); free(rec); } diff --git a/app/src/stream.c b/app/src/stream.c index d1b8b9f3..adc6277f 100644 --- a/app/src/stream.c +++ b/app/src/stream.c @@ -151,7 +151,6 @@ stream_push_packet(struct stream *stream, AVPacket *packet) { if (stream->pending) { // the pending packet must be discarded (consumed or error) - av_packet_unref(stream->pending); av_packet_free(&stream->pending); } @@ -244,7 +243,6 @@ run_stream(void *data) { LOGD("End of frames"); if (stream->pending) { - av_packet_unref(stream->pending); av_packet_free(&stream->pending); }