[Bf-blender-cvs] [8631391baf4] temp-VSE-fixes: VSE: Fix "off by one" error when encoding audio

Sebastian Parborg noreply at git.blender.org
Fri Aug 13 16:49:27 CEST 2021


Commit: 8631391baf49de54c5f3567f8078ec84e737a280
Author: Sebastian Parborg
Date:   Fri Jul 9 15:06:06 2021 +0200
Branches: temp-VSE-fixes
https://developer.blender.org/rB8631391baf49de54c5f3567f8078ec84e737a280

VSE: Fix "off by one" error when encoding audio

Before we didn't encode the audio up until the current frame.
This lead to us not encoding the last video frame of audio.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11918

===================================================================

M	source/blender/blenkernel/intern/writeffmpeg.c

===================================================================

diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 9f3f50febe8..323da7473b5 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -1435,8 +1435,9 @@ int BKE_ffmpeg_append(void *context_v,
   }
 
 #  ifdef WITH_AUDASPACE
-  write_audio_frames(context,
-                     (frame - start_frame) / (((double)rd->frs_sec) / (double)rd->frs_sec_base));
+  /* Add +1 frame because we want to encode audio up until the next video frame. */
+  write_audio_frames(
+      context, (frame - start_frame + 1) / (((double)rd->frs_sec) / (double)rd->frs_sec_base));
 #  endif
   return success;
 }



More information about the Bf-blender-cvs mailing list