Cleanup of aframe if same pts
This commit is contained in:
parent
f2ae6eb05e
commit
c8e45e67bd
@ -1959,9 +1959,11 @@ int main(int argc, char **argv) {
|
|||||||
aframe->pts = (this_audio_frame_time - record_start_time) * (double)AV_TIME_BASE;
|
aframe->pts = (this_audio_frame_time - record_start_time) * (double)AV_TIME_BASE;
|
||||||
const bool same_pts = aframe->pts == audio_prev_pts;
|
const bool same_pts = aframe->pts == audio_prev_pts;
|
||||||
audio_prev_pts = aframe->pts;
|
audio_prev_pts = aframe->pts;
|
||||||
if(same_pts)
|
if(same_pts) {
|
||||||
|
av_frame_unref(aframe);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err = avcodec_send_frame(audio_track.codec_context, aframe);
|
err = avcodec_send_frame(audio_track.codec_context, aframe);
|
||||||
if(err >= 0){
|
if(err >= 0){
|
||||||
|
Loading…
Reference in New Issue
Block a user