aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-04-10 06:17:45 +0200
committerdec05eba <dec05eba@protonmail.com>2023-04-10 06:17:45 +0200
commitc8e45e67bdea6b0acdd3a7bcbb47d8088cb537aa (patch)
treef309fe65397f575ae3427a84280bb48b5680868e /src/main.cpp
parentf2ae6eb05ea29e3e670c501aa86c0bfde081f0f2 (diff)
Cleanup of aframe if same pts
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 9920aaa..c197b19 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1959,8 +1959,10 @@ int main(int argc, char **argv) {
aframe->pts = (this_audio_frame_time - record_start_time) * (double)AV_TIME_BASE;
const bool same_pts = aframe->pts == audio_prev_pts;
audio_prev_pts = aframe->pts;
- if(same_pts)
+ if(same_pts) {
+ av_frame_unref(aframe);
continue;
+ }
}
err = avcodec_send_frame(audio_track.codec_context, aframe);