From 32f5fed744c9f679007bc30b73c2da8f934570f6 Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Thu, 4 Aug 2022 21:40:38 +0900 Subject: [PATCH] * Fix `FFmpegFrameRecorder.record()` incorrectly flushing the video codec on data frames (issue #1858) --- CHANGELOG.md | 1 + src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5c6c6fd..9e4eedfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ + * Fix `FFmpegFrameRecorder.record()` incorrectly flushing the video codec on data frames ([issue #1858](https://github.com/bytedeco/javacv/issues/1858)) * Improve accuracy of `FFmpegFrameGrabber.setFrameNumber()` ([pull #1851](https://github.com/bytedeco/javacv/pull/1851)) * Add `FrameGrabber.resetStartTime()` to allow `grabAtFrameRate()` after operations such as seeking ([pull #1846](https://github.com/bytedeco/javacv/pull/1846)) * Add `FrameGrabber.videoSideData/audioSideData` properties and `FFmpegFrameGrabber.getDisplayRotation()` for convenience ([issue #1361](https://github.com/bytedeco/javacv/issues/1361)) diff --git a/src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java b/src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java index bc7fd304..91cc5e25 100644 --- a/src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java +++ b/src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java @@ -964,7 +964,7 @@ public void stop() throws Exception { record(frame, frame != null && frame.opaque instanceof AVFrame ? ((AVFrame)frame.opaque).format() : AV_PIX_FMT_NONE); } public synchronized void record(Frame frame, int pixelFormat) throws Exception { - if (frame == null || (frame.image == null && frame.samples == null)) { + if (frame == null || (frame.image == null && frame.samples == null && frame.data == null)) { recordImage(0, 0, 0, 0, 0, pixelFormat, (Buffer[])null); } else { if (frame.image != null) {