Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: How to open ALAC packet_decoder? (Read 2117 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to open ALAC packet_decoder?

Since ALAC in Matroska doesn't seem to be currently supported , I just tried to create quite a simple bridge plugin that just forwards A-ALAC setup from Matroska owner to ALAC packet decoder.
So I tried packet_decoder::g_open() with owner_MP4_ALAC. However, other parameters for it is not documented in packet_decoder.h and I couldn't successfully open it. How those params will be?
I tried the following:
p_param1: 0
p_param2: pointer to a buffer containing ALACSpecificConfig, described in ALACMagicCookieDescription.txt in reference encoder source. ALACSpecificConfig is used by Matroska as codec private data.
p_param2size: sizeof ALACSpecificConfig (24 or 48).

Also, I'd like to see complete lists of standard packet decoders and parameter spec for them, if there is any.

How to open ALAC packet_decoder?

Reply #1
OK, I found it out. ALAC packet decoder requires additional 4 byte header before ALACSpecificConfig, that stands for version+flags inside of alac box in M4A container (so it requires whole content of alac box).
This is somewhat silly since it should be quite easy to add support for Matroska owner to the existing ALAC packet decoder, but as a proof of concept (and for my fun), I created it anyway.

Source:
https://github.com/nu774/foo_input_matroska_alac
Binary download:
https://github.com/nu774/foo_input_matroska_alac/releases

How to open ALAC packet_decoder?

Reply #2
I am amazed something simple like this packet decoder isnt in FB2K natively.

How to open ALAC packet_decoder?

Reply #3
This is already simple enough, but things would be simpler if it were implemented in built-in ALAC packet decoder itself.
I guess a few lines of additions to g_is_our_setup() and open() is enough in that case.