Hi,

Sometimes when you convert a video with handbrake, the audio track is missing
from the resulting file.

This is detailed here:
https://bugzilla.rpmfusion.org/show_bug.cgi?id=6006

And the fix is to apply this patch:
https://github.com/HandBrake/HandBrake/commit/f28289fb06ab461ea082b4be56d6d1504c0c31c2

Works for me. The below diff adds the patch to our port. OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/multimedia/handbrake/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- Makefile    31 Mar 2022 16:45:26 -0000      1.13
+++ Makefile    27 Jul 2022 09:35:18 -0000
@@ -2,7 +2,7 @@ V =             1.3.3
 COMMENT =      open source video transcoder
 DISTNAME =     HandBrake-${V}-source
 PKGNAME =      handbrake-${V}
-REVISION =     1
+REVISION =     2
 EXTRACT_SUFX = .tar.bz2
 CATEGORIES =   multimedia x11
 
Index: patches/patch-libhb_encavcodecaudio_c
===================================================================
RCS file: patches/patch-libhb_encavcodecaudio_c
diff -N patches/patch-libhb_encavcodecaudio_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-libhb_encavcodecaudio_c       27 Jul 2022 13:03:23 -0000
@@ -0,0 +1,20 @@
+Fix missing audio tracks.
+
+ * https://bugzilla.rpmfusion.org/show_bug.cgi?id=6006
+ * 
https://github.com/HandBrake/HandBrake/commit/f28289fb06ab461ea082b4be56d6d1504c0c31c2
+
+Index: libhb/encavcodecaudio.c
+--- libhb/encavcodecaudio.c.orig
++++ libhb/encavcodecaudio.c
+@@ -409,7 +409,10 @@ static void Encode(hb_work_object_t *w, hb_buffer_list
+ 
+         // Prepare input frame
+         int     out_size;
+-        AVFrame frame = { .nb_samples = pv->samples_per_frame, };
++        AVFrame frame = { .nb_samples = pv->samples_per_frame,
++                          .format = pv->context->sample_fmt,
++                          .channels = pv->context->channels
++        };
+ 
+         out_size = av_samples_get_buffer_size(NULL,
+                                               pv->context->channels,

-- 
Best Regards
Edd Barrett

https://www.theunixzoo.co.uk

Reply via email to