<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/4e121c20f6671f4a9fae2b886bd34cab7bbd2728">https://github.com/macports/macports-ports/commit/4e121c20f6671f4a9fae2b886bd34cab7bbd2728</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 4e121c20f66 ffmpeg: fix videotoolbox encoding error: invalid DTS Upstream issue: https://trac.ffmpeg.org/ticket/9439 Fixes: https://trac.macports.org/ticket/64022
</span>4e121c20f66 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 4e121c20f6671f4a9fae2b886bd34cab7bbd2728
</span>Author: Christopher Nielsen <mascguy@github.com>
AuthorDate: Wed Jun 8 12:26:49 2022 -0400
<span style='display:block; white-space:pre;color:#404040;'> ffmpeg: fix videotoolbox encoding error: invalid DTS
</span><span style='display:block; white-space:pre;color:#404040;'> Upstream issue: https://trac.ffmpeg.org/ticket/9439
</span><span style='display:block; white-space:pre;color:#404040;'> Fixes: https://trac.macports.org/ticket/64022
</span>---
multimedia/ffmpeg/Portfile | 12 +++++++++---
.../files/patch-issue-9439-non-b-frame-encoding.diff | 18 ++++++++++++++++++
2 files changed, 27 insertions(+), 3 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/ffmpeg/Portfile b/multimedia/ffmpeg/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index b351ce1f2a6..454501d56a5 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/multimedia/ffmpeg/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/multimedia/ffmpeg/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -19,7 +19,7 @@ conflicts ffmpeg-devel
</span> # Please increase the revision of mpv whenever ffmpeg's version is updated.
epoch 1
version 4.4.1
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 6
</span> license LGPL-2.1+
categories multimedia
maintainers {devans @dbevans} {jeremyhu @jeremyhu} {mascguy @mascguy} openmaintainer
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -96,12 +96,18 @@ depends_lib port:lame \
</span>
patchfiles patch-libavcodec-audiotoolboxenc.c.diff
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# fix an upstream bug that overrides the max_b_frames setting
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Fix an upstream bug that overrides the max_b_frames setting
</span> # https://trac.ffmpeg.org/ticket/9231
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# this bug is fixed upstream in commit 55d9d6767967794edcdd6e1bbd8840fc6f4e9315
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# This bug is fixed upstream in commit 55d9d6767967794edcdd6e1bbd8840fc6f4e9315
</span> # and should therefore be available in the next release version.
patchfiles-append patch-libavcodec-videotoolboxenc.c.diff
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# Patch for upstream bug related to non-B-frame encoding
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://trac.ffmpeg.org/ticket/9439
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Fixed via upstream commit: b786bc7433dfe082441a57c1ba9ae9ea47904b78
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Will be available in the next release version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append patch-issue-9439-non-b-frame-encoding.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # enable auto configure of asm optimizations
# requires Xcode 3.1 or better on Leopard
#
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/ffmpeg/files/patch-issue-9439-non-b-frame-encoding.diff b/multimedia/ffmpeg/files/patch-issue-9439-non-b-frame-encoding.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..25fa01d79ae
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/multimedia/ffmpeg/files/patch-issue-9439-non-b-frame-encoding.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,18 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- libavcodec/videotoolboxenc.c.orig 2021-12-11 09:44:23.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ libavcodec/videotoolboxenc.c 2021-12-11 09:42:05.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+avcodec/videotoolboxenc: Fix non-B-Frame encoding
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* Sets vtctx->has_b_frames to 0 if the VideoToolbox compression session will not emit B-frames (and, in consequence, no valid DTSs).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* Required for the handling of invalid DTSs in 'vtenc_cm_to_avpacket' (line 2018ff) to work correctly and not abort encoding with "DTS is invalid" when no B-frames are generated.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* See: https://trac.ffmpeg.org/ticket/9439
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1516,7 +1516,10 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!status && has_b_frames_cfbool) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ //Some devices don't output B-frames for main profile, even if requested.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // HEVC has b-pyramid
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vtctx->has_b_frames = (CFBooleanGetValue(has_b_frames_cfbool) && avctx->codec_id == AV_CODEC_ID_HEVC) ? 2 : 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (CFBooleanGetValue(has_b_frames_cfbool))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vtctx->has_b_frames = avctx->codec_id == AV_CODEC_ID_HEVC ? 2 : 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vtctx->has_b_frames = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ CFRelease(has_b_frames_cfbool);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ avctx->has_b_frames = vtctx->has_b_frames;
</span></pre><pre style='margin:0'>
</pre>