Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from HandBrake:master #379

Open
wants to merge 173 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
a209849
contrib: update fribidi to 1.0.16 (#6328)
hnsteyding Oct 8, 2024
b374668
contrib: update libdovi to 3.3.1 (#6220)
hnsteyding Oct 9, 2024
1ad8ba3
WinGui: Attempt to better handle the case where we can't communicate …
sr55 Oct 9, 2024
f6fb090
libhb: set default VCE encoder profile to auto (#6343)
Hotactioncop Oct 10, 2024
5fa1e55
rotate_vt: silence a warning
galad87 Oct 10, 2024
45db267
encavcodec: do not set a short GOP for VCE
galad87 Oct 10, 2024
a2af77b
Update NEWS
galad87 Oct 10, 2024
6332b5a
lingua: change string "Finish Current, Start Next" to "Finish Current…
bickman2k Oct 10, 2024
258cfd2
Revert "encavcodec: do not set a short GOP for VCE"
galad87 Oct 10, 2024
e17d84f
colorspace: add a npl param to make it possible to set the nominal pe…
galad87 Oct 11, 2024
f9ca1c9
actions: fix Linux CI
galad87 Oct 11, 2024
e0226b9
MacGui: fix the 'destination same as source' option when the source f…
galad87 Oct 12, 2024
937cf3e
WinGui: Remove an unnecessary height limit in the queue view that was…
sr55 Oct 13, 2024
1eead5a
WinGui: Further very minor tweak to queue record density to allow an …
sr55 Oct 13, 2024
ea0c0bb
MacGui: simplify the 'destination same as source' code
galad87 Oct 16, 2024
c54858d
libhb: force default scale filter instead of zscale for snapdragon de…
dashsantosh-mcw Oct 16, 2024
843040f
Global replacement of passthrough with passthru
joshstephenson Oct 19, 2024
aee5ab4
libhb: update presets MetadataPassthrough key to MetadataPassthru
galad87 Oct 19, 2024
28c755b
contrib: update AMF to 1.4.35
hnsteyding Oct 19, 2024
0cbff6c
contrib: fix amfenc color info
galad87 Oct 19, 2024
4f502be
WinGui: Spelling correction. Fixes #6360
sr55 Oct 19, 2024
91192d9
contrib: update libdav1d to 1.5.0 (#6359)
hnsteyding Oct 20, 2024
1954926
contrib: disable AMD drivers version check (#6357)
galad87 Oct 20, 2024
c1e0c80
libhb: add alac passthru and encoders
galad87 Oct 21, 2024
79a994f
libhb: enable vorbis passthru
galad87 Oct 21, 2024
78f3449
gtk: winui: macui: add vorbis and alac auto passhtru
galad87 Oct 21, 2024
0bb68da
encavcodecaudio: convert the 6.1 and 7.1 channel layouts to the ones …
galad87 Oct 21, 2024
db4948d
encavcodec: add support for mf_av1 encoder (#6341)
dashsantosh-mcw Oct 23, 2024
b066cf9
decavsub/rendersub: render bitmaps in 444P and blend them chroma-alig…
cubicibo Aug 16, 2024
ff801f7
contrib/ffmpeg: Improve PGS decoder.
cubicibo Oct 11, 2024
2fdfd34
rendersub: support arbitrary overlay pixel fmt at blend, round ASS ov…
cubicibo Oct 16, 2024
edaa40e
rendersub: cosmetics
galad87 Oct 24, 2024
a9f1ad7
Update config.guess to version 2024-07-27
Nomis101 Oct 24, 2024
df85568
rendersub: subdivide non overlapping ssa rects to avoid blending larg…
galad87 Oct 26, 2024
053f517
encavcodecaudio: properly set the AVFrame channel layout
galad87 Oct 29, 2024
45ccf41
Update NEWS
galad87 Oct 29, 2024
51e5448
libhb: wingui: add support for Max Duration of Scan titles for disc b…
sr55 Oct 30, 2024
b3f4862
MacGui: add a max title duration preferences
galad87 Oct 22, 2024
14e25a1
contrib: update SVT-AV1 to version 2.3.0 (#6376)
galad87 Oct 30, 2024
de0f4db
filter: add neon optimizations for motion metric + comb detect (#6346)
dashsantosh-mcw Oct 30, 2024
14904d6
scan: do not set data->title_set->path to the path of the last scanne…
galad87 Oct 31, 2024
ef2a3fb
hwaccel: fix regression (#6379)
galinart Nov 1, 2024
7523092
flatpak: Update SDK and libraries (#6384)
robxnano Nov 1, 2024
0caff0a
WinGUI: set hyper encode to off by default (#6380)
galinart Nov 1, 2024
55c95f9
qsv: enable AV1 screen content tools
galinart Sep 27, 2024
42698eb
qsv: update platform codenames
galinart Sep 27, 2024
dd8cdce
qsv: fix AV1 SCC query
galinart Nov 1, 2024
48461b7
flatpak: libdovi tarball was repacked to fix a build issue on github…
sr55 Nov 3, 2024
7b2076a
rendersub: refactor how subs are applied
galad87 Nov 1, 2024
8c032a5
rendersub: move the blend functions to a separate file
galad87 Nov 2, 2024
dbe4acb
decavcodec: fix a memory leak
galad87 Nov 4, 2024
11fa999
[LinuxGUI] Update all locales (#6395)
Nomis101 Nov 5, 2024
aed8031
Add a Github Bot to manage Issues and Pull Requests
sr55 Nov 5, 2024
9cfde11
Update stale_bot.yml
sr55 Nov 5, 2024
87e93e4
Update issue_bot.yml
sr55 Nov 5, 2024
498f217
Update stale_bot.yml
sr55 Nov 5, 2024
457286f
Update stale_bot.yml
sr55 Nov 5, 2024
3ef4ba6
Update stale_bot.yml
sr55 Nov 5, 2024
257fceb
Update stale_bot.yml
sr55 Nov 5, 2024
2ef186d
libhb: add a function to duplicate an hb_buffer without copying the d…
galad87 Nov 6, 2024
ee4448a
libhb: fix transpose of 422 pixel formats
galad87 Nov 7, 2024
2bbbc37
encvt: expose qp modulation and look ahead frames advanced options
Nov 8, 2024
178151f
libhb: fix a couple of dead assignments and leaks found by clang stat…
galad87 Nov 9, 2024
6dddef2
contrib: update HarfBuzz to 10.1.0 (#6397)
hnsteyding Nov 10, 2024
8144fab
MacGUI: update all locales (#6399)
Nomis101 Nov 10, 2024
cec6c0f
[winGUI] Update all locales and add swedish (#6402)
Nomis101 Nov 10, 2024
a71cf61
NEWS: Updated
sr55 Nov 10, 2024
a483317
WinGui: Bump verison to 1.9
sr55 Nov 10, 2024
cbfd6f6
actions: Add flatpak build to our CI pipeline.
sr55 Nov 10, 2024
b3dd8a3
actions: Tidyup and upload artefact
sr55 Nov 10, 2024
aafdf59
contrib: update libvpx to 1.15.0
galad87 Nov 11, 2024
0ce5a3a
MacGUI: add swedish language (#6406)
Nomis101 Nov 12, 2024
baa5d65
rendersub: use ASS track YCbCrMatrix field.
cubicibo Nov 12, 2024
ed8cbd1
NVENC support in H.264 and H.265 broken since FFMPEG 7.1 #6340 (#6411)
samhutchins Nov 13, 2024
82d3e55
WinGui: Library Updates
sr55 Nov 13, 2024
c4b1ec3
MacGui: add 'Scale to Screen' and 'Actual Size' menu items to scale t…
galad87 Nov 15, 2024
a153100
encvt: disable automatic data rate limits because they don't work pro…
galad87 Nov 15, 2024
7c0b6d3
LinGui: Add support for Max Duration
samhutchins Nov 12, 2024
3c1f1aa
Force Ubuntu 24 for Flatpak builds
sr55 Nov 16, 2024
73d27aa
gtk: Escape preset names in menu actions
robxnano Nov 16, 2024
6e600c3
gtk: Refactor and simplify queue item removal code
robxnano Sep 15, 2024
d565b5f
gtk: Always add imported presets to a folder
robxnano Sep 21, 2024
2893d3c
gtk: Don't change names of custom preset folders
robxnano Sep 21, 2024
9be7557
gtk: Only show custom folders in preset add dialog
robxnano Sep 21, 2024
4d4724c
gtk: Confirm overwrite when importing preset
robxnano Sep 21, 2024
e2c1df1
gtk: Confirm overwrite in preset Save As dialog
robxnano Sep 22, 2024
22c6b12
gtk: Fix infinite loop when loading presets
robxnano Sep 22, 2024
f0a7748
gtk: Ensure imported presets are marked as custom
robxnano Sep 25, 2024
cef5b32
gtk: Update translation template
robxnano Nov 16, 2024
6f2cd46
libhb: store the initial Dolby Vision RPU and attach it to the genera…
galad87 Nov 17, 2024
3aa5549
Flatpak Build -> Remove bad package
sr55 Nov 18, 2024
c9567ed
encvt: add an additional log message to better debug multi-pass issues
galad87 Nov 18, 2024
890e630
encvt: set the session pass storage when creating the extradata
galad87 Nov 20, 2024
81570ef
MacGui: improve search of the common parent url in the 'destination s…
galad87 Nov 20, 2024
a672cf5
MacGui: update Sparkle to verison 2.6.4
galad87 Nov 21, 2024
85de03e
flatpak: Override libdir in CMake-built modules (#6428)
robxnano Nov 21, 2024
640f498
flatpak: Update metainfo (#6421)
robxnano Nov 22, 2024
8c4803a
[macGUI] Update all locales (#6431)
Nomis101 Nov 23, 2024
824ee79
[LinuxGUI] Update all locales (#6432)
Nomis101 Nov 23, 2024
3e6479d
contrib: update x265 to version 4.1 (#6430)
galad87 Nov 23, 2024
ffbd0be
[winGUI] Update all locales (#6433)
Nomis101 Nov 23, 2024
85b206c
scripts: update to mac-toolchain-build 2.12.0
galad87 Nov 23, 2024
1969462
workflows: update macOS workflow
galad87 Nov 23, 2024
2d89506
Update NEWS
galad87 Nov 23, 2024
20db563
preset: set VideoToolbox presets to H.265 10-bit
galad87 Nov 24, 2024
9a59fb9
Update NEWS (#6435)
Nomis101 Nov 24, 2024
34eaff0
gtk: Fix preview black borders on Wayland
robxnano Nov 17, 2024
b44dbd8
gtk: Remove rounded corners from preview window
robxnano Nov 17, 2024
cd71668
gtk: Fix a crash that could occur if encoder was invalid
robxnano Nov 22, 2024
8bffe18
Update SECURITY.md
sr55 Nov 26, 2024
7b65852
Update SECURITY.md
sr55 Nov 26, 2024
83f4538
Update stale_bot.yml
sr55 Nov 28, 2024
2848a38
libhb: x265: add new matrix coefficients from H.273 v3
galad87 Nov 30, 2024
7cac7cb
MacGui: properly reset the chapters popup menu when switching trim type
galad87 Dec 1, 2024
fa9154a
Update NEWS
galad87 Dec 1, 2024
62c99ee
Update stale_bot.yml
sr55 Dec 2, 2024
d9ba035
libhb: add hb_get_preview() that can output to a specific pixel format
galad87 Dec 3, 2024
855f51b
build: fix gcc14 aarch64 build failure (#6463)
dashsantosh-mcw Dec 4, 2024
fb392c5
MacGui: fix a warning
galad87 Dec 5, 2024
fbfb089
MacGui: add a way to generate and display CVPixelBuffers
galad87 Dec 5, 2024
734b31f
WinGui: Add preference: "Default Range Mode for Titles". See Prefere…
sr55 Dec 8, 2024
70d5eb3
WinGui: Add "Angle" to autoname filename options (#6086)
sr55 Dec 8, 2024
ea108f9
WinGui: Added a new preference to run a custom action when the queue …
sr55 Dec 8, 2024
0862207
Update SECURITY.md
sr55 Dec 8, 2024
9349aca
WinGui: Trigger an update of autoname for angle option. (#6086)
sr55 Dec 8, 2024
68e45a1
WinGui: Remove erroneous part of anamorphic tooltip. #6473
sr55 Dec 9, 2024
1687790
WinGui: Reset Titlebar / Taskbar Progress when we have multiple encod…
sr55 Dec 10, 2024
7b2677a
MacGui: cleanup preview generation code
galad87 Dec 11, 2024
029d30f
libhb: set default profile AUTO for VCE encoders (#6479)
Hotactioncop Dec 12, 2024
e1cb6a7
contrib: update libjpeg-turbo to 3.1.0 (#6486)
hnsteyding Dec 17, 2024
69ca3db
svt-av1: enable dotprod and i8mm for Win Arm64 (#6480)
dashsantosh-mcw Dec 17, 2024
93ecbb2
svt-av1: check all cores to enable I8MM on Win Arm64 (#6493)
dashsantosh-mcw Dec 21, 2024
b0131f3
Minor Clarifications and Disclaimer added to Code of Conduct.
sr55 Dec 22, 2024
109766e
WinGui: Add some missing tooltips to the Picture settings tab.
sr55 Dec 22, 2024
cab6cd5
WinGui: Don't crash if we have a chapters mis-match when importing. F…
sr55 Dec 29, 2024
7081be7
WinGui: Fix an issue with the autoname function not updating when tit…
sr55 Dec 29, 2024
b6902b3
UI: mention in the tooltip that video presets on the right of the sli…
galad87 Jan 2, 2025
fa695bf
MacGui: add a contextual menu to the previews outline view
galad87 Jan 2, 2025
4d33a12
ui: fix preset slider tooltip
galad87 Jan 2, 2025
eccf365
WinGui: Fix an issue where the audio encoder may not display correctl…
sr55 Jan 2, 2025
3d355f2
preset: Add Social 10 MB presets.
bradleysepos Dec 24, 2024
65010bc
WinGui: Minor usability improvements
sr55 Jan 5, 2025
b2d9418
update NEWS
sr55 Jan 5, 2025
9216e00
WinGui: Add {destination_folder} as an option to the Send File To Pre…
sr55 Jan 5, 2025
6e9805e
wingui: remove extraneous word from format options description (#6537)
randomascii Jan 9, 2025
eb60728
Update SECURITY.md
sr55 Jan 10, 2025
fecb190
nv-codec-headers: Harden DLL loading so that it only uses system32 fo…
sr55 Jan 11, 2025
712b376
libhb: cli: add a way to disable hdr dynamic metadata passthru (#6518)
galad87 Jan 13, 2025
ef73e61
MacGui: remove Xcode project debug arguments
galad87 Jan 14, 2025
60e9773
libhb: check if chapters titles are valid utf-8, if not fall back to …
galad87 Jan 15, 2025
0fc443c
contrib: update HarfBuzz to 10.2.0 (#6558)
hnsteyding Jan 16, 2025
507cdc9
contrib: update libvpl to 2.14.0 (#6491)
hnsteyding Jan 16, 2025
6263fe6
linui: fix title background on file conflict (#6538)
jchilds0 Jan 16, 2025
465e2d8
libhb: ui: cleanup video tunes, rename svt-av1 none to vq (#6556)
galad87 Jan 18, 2025
f6b2bbd
libhb: disable dynamic metadata when the source file has got none"
galad87 Jan 18, 2025
1302f0b
encavcodec: set MF AVScenario to ARCHIVE by default (#6371)
dashsantosh-mcw Jan 19, 2025
b3923e0
build: generate pdb for llvm-mingw aarch64 builds (#6488)
dashsantosh-mcw Jan 19, 2025
62ffcf7
libhb: improve the encoder pixel format selection
galad87 Jan 21, 2025
2900c75
contrib: update libdav1d to 1.5.1 (#6567)
hnsteyding Jan 21, 2025
4c879d8
Update copyright dates to 2025 (#6568)
Nomis101 Jan 22, 2025
0fd2156
LinGui: add support for running a command after an encode completes (…
samhutchins Jan 23, 2025
03dac4c
MacGui: set dispatch queues autorelease frequency
galad87 Jan 24, 2025
eee7111
MacGui: xcode project version check
galad87 Jan 24, 2025
a3c7db2
MacGui: run log cleaning at Background QoS (#6575)
lunacookies Jan 25, 2025
ee0f743
contrib: update sse2neon to 1.8.0 (#6570)
hnsteyding Jan 25, 2025
dbbcba8
rendersub: add metal accelerated blend functions
galad87 Jan 25, 2025
4254c78
WinGui: Fix an issue with the Autoname helper where the pre/postfix f…
sr55 Jan 25, 2025
60866eb
MacGui: remove unused `-[HBQueueController visible]` property (#6577)
lunacookies Jan 25, 2025
88b548a
Update official AV1 presets (#6585)
Nomis101 Jan 28, 2025
992c94c
rendersub: port the subsample code to metal blend
galad87 Jan 29, 2025
58324b1
[winGUI] Update all locales (#6593)
Nomis101 Jan 30, 2025
dd50dd3
[mac GUI] Update all locales (#6592)
Nomis101 Jan 30, 2025
4fd316d
[Linux GUI] Update all locales (#6594)
Nomis101 Jan 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
libhb: add alac passthru and encoders
  • Loading branch information
galad87 committed Oct 22, 2024
commit c1e0c803c771c4d0dbe8ef663d2ad5c315453e63
1 change: 1 addition & 0 deletions contrib/ffmpeg/module.defs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ FFMPEG.CONFIGURE.extra = \
--enable-encoder=aac \
--enable-encoder=ac3 \
--enable-encoder=eac3 \
--enable-encoder=alac \
--enable-encoder=flac \
--enable-encoder=mpeg2video \
--enable-encoder=mpeg4 \
Expand Down
33 changes: 33 additions & 0 deletions libhb/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ enum
HB_GID_VCODEC_AV1_NVENC,
HB_GID_VCODEC_AV1_VCE,
HB_GID_VCODEC_FFV1,
HB_GID_ACODEC_ALAC,
HB_GID_ACODEC_ALAC_PASS,
HB_GID_ACODEC_AAC,
HB_GID_ACODEC_AAC_HE,
HB_GID_ACODEC_AAC_PASS,
Expand Down Expand Up @@ -446,6 +448,9 @@ hb_encoder_internal_t hb_audio_encoders[] =
{ { "FLAC 16-bit", "flac16", "FLAC 16-bit (libavcodec)", HB_ACODEC_FFFLAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_FLAC, },
{ { "FLAC 24-bit", "flac24", "FLAC 24-bit (libavcodec)", HB_ACODEC_FFFLAC24, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_FLAC, },
{ { "FLAC Passthru", "copy:flac", "FLAC Passthru", HB_ACODEC_FLAC_PASS, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_FLAC_PASS, },
{ { "ALAC 16-bit", "alac16", "ALAC 16-bit (libavcodec)", HB_ACODEC_FFALAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_ALAC, },
{ { "ALAC 24-bit", "alac24", "ALAC 24-bit (libavcodec)", HB_ACODEC_FFALAC24, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_ALAC, },
{ { "ALAC Passthru", "copy:alac", "ALAC Passthru", HB_ACODEC_ALAC_PASS, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_ALAC_PASS, },
{ { "Auto Passthru", "copy", "Auto Passthru", HB_ACODEC_AUTO_PASS, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_AUTO_PASS, },
};
int hb_audio_encoders_count = sizeof(hb_audio_encoders) / sizeof(hb_audio_encoders[0]);
Expand Down Expand Up @@ -476,6 +481,10 @@ static int hb_audio_encoder_is_enabled(int encoder)
case HB_ACODEC_AC3:
return avcodec_find_encoder(AV_CODEC_ID_AC3) != NULL;

case HB_ACODEC_FFALAC:
case HB_ACODEC_FFALAC24:
return avcodec_find_encoder(AV_CODEC_ID_ALAC) != NULL;

case HB_ACODEC_FFEAC3:
return avcodec_find_encoder(AV_CODEC_ID_EAC3) != NULL;

Expand Down Expand Up @@ -1134,6 +1143,8 @@ int hb_audio_bitrate_get_default(uint32_t codec, int samplerate, int mixdown)

switch (codec)
{
case HB_ACODEC_FFALAC:
case HB_ACODEC_FFALAC24:
case HB_ACODEC_FFFLAC:
case HB_ACODEC_FFFLAC24:
case HB_ACODEC_FFTRUEHD:
Expand Down Expand Up @@ -1322,6 +1333,8 @@ void hb_audio_bitrate_get_limits(uint32_t codec, int samplerate, int mixdown,
switch (codec)
{
// Bitrates don't apply to "lossless" audio
case HB_ACODEC_FFALAC:
case HB_ACODEC_FFALAC24:
case HB_ACODEC_FFFLAC:
case HB_ACODEC_FFFLAC24:
case HB_ACODEC_FFTRUEHD:
Expand Down Expand Up @@ -2188,6 +2201,14 @@ void hb_audio_compression_get_limits(uint32_t codec, float *low, float *high,
{
switch (codec)
{
case HB_ACODEC_FFALAC:
case HB_ACODEC_FFALAC24:
*direction = 0;
*granularity = 1.;
*high = 2.;
*low = 0.;
break;

case HB_ACODEC_FFFLAC:
case HB_ACODEC_FFFLAC24:
*direction = 0;
Expand Down Expand Up @@ -2234,6 +2255,10 @@ float hb_audio_compression_get_default(uint32_t codec)
{
switch (codec)
{
case HB_ACODEC_FFALAC:
case HB_ACODEC_FFALAC24:
return 2.;

case HB_ACODEC_FFFLAC:
case HB_ACODEC_FFFLAC24:
return 5.;
Expand Down Expand Up @@ -2370,6 +2395,8 @@ int hb_mixdown_has_codec_support(int mixdown, uint32_t codec)
switch (codec)
{
case HB_ACODEC_VORBIS:
case HB_ACODEC_FFALAC:
case HB_ACODEC_FFALAC24:
case HB_ACODEC_FFFLAC:
case HB_ACODEC_FFFLAC24:
case HB_ACODEC_OPUS:
Expand Down Expand Up @@ -2538,6 +2565,8 @@ int hb_mixdown_get_default(uint32_t codec, uint64_t layout)
switch (codec)
{
// the FLAC encoder defaults to the best mixdown up to 7.1
case HB_ACODEC_FFALAC:
case HB_ACODEC_FFALAC24:
case HB_ACODEC_FFFLAC:
case HB_ACODEC_FFFLAC24:
case HB_ACODEC_OPUS:
Expand Down Expand Up @@ -2790,6 +2819,10 @@ int hb_audio_encoder_get_fallback_for_passthru(int passthru)
const hb_encoder_t *audio_encoder = NULL;
switch (passthru)
{
case HB_ACODEC_ALAC_PASS:
gid = HB_GID_ACODEC_ALAC;
break;

case HB_ACODEC_AAC_PASS:
gid = HB_GID_ACODEC_AAC;
break;
Expand Down
16 changes: 16 additions & 0 deletions libhb/encavcodecaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@ static int encavcodecaInit(hb_work_object_t *w, hb_job_t *job)
channel_layout = AV_CH_LAYOUT_5POINT1_BACK;
break;

case HB_ACODEC_FFALAC:
case HB_ACODEC_FFALAC24:
codec_id = AV_CODEC_ID_ALAC;
switch (audio->config.out.codec)
{
case HB_ACODEC_FFALAC24:
sample_fmt = AV_SAMPLE_FMT_S32;
bits_per_raw_sample = 24;
break;
default:
sample_fmt = AV_SAMPLE_FMT_S16;
bits_per_raw_sample = 16;
break;
}
break;

case HB_ACODEC_FFFLAC:
case HB_ACODEC_FFFLAC24:
codec_id = AV_CODEC_ID_FLAC;
Expand Down
9 changes: 6 additions & 3 deletions libhb/handbrake/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,9 @@ struct hb_job_s
/* Audio Codecs: Update win/CS/HandBrake.Interop/Interop/HbLib/NativeConstants.cs when changing these consts */
#define HB_ACODEC_INVALID 0x00000000
#define HB_ACODEC_NONE 0x00000001
#define HB_ACODEC_MASK 0x0FFFFF01
#define HB_ACODEC_MASK 0x0FFFFF81
#define HB_ACODEC_FFALAC 0x00000080
#define HB_ACODEC_FFALAC24 0x00000100
#define HB_ACODEC_LAME 0x00000200
#define HB_ACODEC_VORBIS 0x00000400
#define HB_ACODEC_AC3 0x00000800
Expand All @@ -889,13 +891,14 @@ struct hb_job_s
#define HB_ACODEC_FFEAC3 0x01000000
#define HB_ACODEC_FFTRUEHD 0x02000000
#define HB_ACODEC_OPUS 0x04000000
#define HB_ACODEC_FF_MASK 0x0FFF2800
#define HB_ACODEC_FF_MASK 0x0FFF2980
#define HB_ACODEC_PASS_FLAG 0x40000000
#define HB_ACODEC_PASS_MASK (HB_ACODEC_AC3 | HB_ACODEC_DCA | HB_ACODEC_DCA_HD | HB_ACODEC_FFAAC | HB_ACODEC_FFEAC3 | HB_ACODEC_FFFLAC | HB_ACODEC_MP2 | HB_ACODEC_MP3 | HB_ACODEC_FFTRUEHD | HB_ACODEC_OPUS)
#define HB_ACODEC_PASS_MASK (HB_ACODEC_AC3 | HB_ACODEC_DCA | HB_ACODEC_DCA_HD | HB_ACODEC_FFAAC | HB_ACODEC_FFEAC3 | HB_ACODEC_FFALAC | HB_ACODEC_FFFLAC | HB_ACODEC_MP2 | HB_ACODEC_MP3 | HB_ACODEC_FFTRUEHD | HB_ACODEC_OPUS)
#define HB_ACODEC_AUTO_PASS (HB_ACODEC_PASS_FLAG | HB_ACODEC_PASS_MASK)
#define HB_ACODEC_ANY (HB_ACODEC_PASS_FLAG | HB_ACODEC_MASK)
#define HB_ACODEC_AAC_PASS (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFAAC)
#define HB_ACODEC_AC3_PASS (HB_ACODEC_PASS_FLAG | HB_ACODEC_AC3)
#define HB_ACODEC_ALAC_PASS (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFALAC)
#define HB_ACODEC_DCA_PASS (HB_ACODEC_PASS_FLAG | HB_ACODEC_DCA)
#define HB_ACODEC_DCA_HD_PASS (HB_ACODEC_PASS_FLAG | HB_ACODEC_DCA_HD)
#define HB_ACODEC_EAC3_PASS (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFEAC3)
Expand Down
4 changes: 4 additions & 0 deletions libhb/muxavformat.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,10 @@ static int avformatInit( hb_mux_object_t * m )
case HB_ACODEC_OPUS:
track->st->codecpar->codec_id = AV_CODEC_ID_OPUS;
break;
case HB_ACODEC_FFALAC:
case HB_ACODEC_FFALAC24:
track->st->codecpar->codec_id = AV_CODEC_ID_ALAC;
break;
case HB_ACODEC_FFFLAC:
case HB_ACODEC_FFFLAC24:
track->st->codecpar->codec_id = AV_CODEC_ID_FLAC;
Expand Down
2 changes: 2 additions & 0 deletions libhb/preset.c
Original file line number Diff line number Diff line change
Expand Up @@ -3634,6 +3634,8 @@ static void import_audio_0_0_0(hb_value_t *preset)
hb_value_array_append(copy, hb_value_string("copy:dtshd"));
if (hb_value_get_bool(hb_dict_get(preset, "AudioAllowEAC3Pass")))
hb_value_array_append(copy, hb_value_string("copy:eac3"));
if (hb_value_get_bool(hb_dict_get(preset, "AudioAllowALACPass")))
hb_value_array_append(copy, hb_value_string("copy:alac"));
if (hb_value_get_bool(hb_dict_get(preset, "AudioAllowFLACPass")))
hb_value_array_append(copy, hb_value_string("copy:flac"));
if (hb_value_get_bool(hb_dict_get(preset, "AudioAllowTRUEHDPass")))
Expand Down
6 changes: 6 additions & 0 deletions libhb/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,9 @@ static void LookForAudio(hb_scan_t *scan, hb_title_t * title, hb_audio_t * audio
case AV_CODEC_ID_AC3:
codec_name = "AC3";
break;
case AV_CODEC_ID_ALAC:
codec_name = "ALAC";
break;
case AV_CODEC_ID_EAC3:
codec_name = "E-AC3";
break;
Expand Down Expand Up @@ -1633,6 +1636,9 @@ static void LookForAudio(hb_scan_t *scan, hb_title_t * title, hb_audio_t * audio
case HB_ACODEC_FFEAC3:
codec_name = "E-AC3";
break;
case HB_ACODEC_FFALAC:
codec_name = "ALAC";
break;
case HB_ACODEC_FFTRUEHD:
codec_name = "TrueHD";
break;
Expand Down
6 changes: 6 additions & 0 deletions libhb/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -5542,6 +5542,12 @@ static void add_ffmpeg_audio(hb_title_t *title, hb_stream_t *stream, int id)
audio->config.in.codec = HB_ACODEC_AC3;
break;

case AV_CODEC_ID_ALAC:
{
hb_set_extradata(&audio->priv.extradata, codecpar->extradata, codecpar->extradata_size);
audio->config.in.codec = HB_ACODEC_FFALAC;
} break;

case AV_CODEC_ID_EAC3:
audio->config.in.codec = HB_ACODEC_FFEAC3;
break;
Expand Down
8 changes: 6 additions & 2 deletions win/CS/HandBrake.Interop/Interop/HbLib/NativeConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,28 @@ namespace HandBrake.Interop.Interop.HbLib
public class NativeConstants
{
// Audio encoders
public const uint HB_ACODEC_FFALAC = 0x00000080;
public const uint HB_ACODEC_FFALAC24 = 0x00000100;
public const uint HB_ACODEC_AC3 = 0x00000800;
public const uint HB_ACODEC_DCA = 0x00002000;
public const uint HB_ACODEC_FFAAC = 0x00010000;
public const uint HB_ACODEC_DCA_HD = 0x00040000;
public const uint HB_ACODEC_MP3 = 0x00080000;
public const uint HB_ACODEC_FFFLAC = 0x00100000;
public const uint HB_ACODEC_FFFLAC_24 = 0x00200000;
public const uint HB_ACODEC_FFEAC3 = 0x01000000;
public const uint HB_ACODEC_FFTRUEHD = 0x02000000;
public const uint HB_ACODEC_OPUS = 0x04000000;
public const uint HB_ACODEC_MP2 = 0x08000000;
public const uint HB_ACODEC_PASS_FLAG = 0x40000000;
public const uint HB_ACODEC_PASS_MASK = (HB_ACODEC_AC3 | HB_ACODEC_DCA | HB_ACODEC_DCA_HD | HB_ACODEC_FFAAC | HB_ACODEC_FFEAC3 | HB_ACODEC_FFFLAC | HB_ACODEC_MP2 | HB_ACODEC_MP3 | HB_ACODEC_FFTRUEHD | HB_ACODEC_OPUS);
public const uint HB_ACODEC_PASS_MASK = (HB_ACODEC_AC3 | HB_ACODEC_DCA | HB_ACODEC_DCA_HD | HB_ACODEC_FFAAC | HB_ACODEC_FFEAC3 | HB_ACODEC_FFALAC | HB_ACODEC_FFFLAC | HB_ACODEC_MP2 | HB_ACODEC_MP3 | HB_ACODEC_FFTRUEHD | HB_ACODEC_OPUS);

public const uint HB_ACODEC_MASK = 0x0FFFFF01;
public const uint HB_ACODEC_MASK = 0x0FFFFF81;
public const uint HB_ACODEC_AUTO_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_PASS_MASK);
public const uint HB_ACODEC_ANY = (HB_ACODEC_PASS_FLAG | HB_ACODEC_MASK);
public const uint HB_ACODEC_AAC_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFAAC);
public const uint HB_ACODEC_AC3_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_AC3);
public const uint HB_ACODEC_ALAC_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFALAC);
public const uint HB_ACODEC_DCA_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_DCA);
public const uint HB_ACODEC_DCA_HD_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_DCA_HD);
public const uint HB_ACODEC_EAC3_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFEAC3);
Expand Down