Thread: Avisynth+
View Single Post
Old 7th January 2019, 17:26   #4385  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
Quote:
Originally Posted by tebasuna51 View Post
Is a usseless option.

Who know the ChannelMask of a audio are the decoders, do you know any decoder (ffms2.dll, LSMASHSource.dll, NicAudio.dll, ...) than set ChannelMask to the appropiate value?

There are any audio encoder/player, than accept avs input, than use that global variable if defined?

Also, if there are two, or more, audios processed at same time, how we can distinguise both?

The ChannelMask must be a property of each audio clip.
FFMS sets the script variable FFCHANNEL_LAYOUT which contains the dwChannelMask. You can get one variable per clip using the varprefix option if you like.

Quote:
Originally Posted by davidhorman View Post
Before I go ahead and do this, can anyone raise any objections to the idea of using an audio channel to pass metadata? My filter passes data through the video frame, but it also needs to send a few bytes of metadata with it, so my plan is to override GetAudio and just paste those bytes into the buffer. The other filter in the partnership will then call GetAudio to get the metadata.

Good idea? Bad idea?
num_audio_samples is a 64-bit integer. It's like it was made to use as an arbitrary pointer! Distinguishing a valid pointer from any other arbitrary integer is left as an exercise for the reader.

Seriously though, putting arbitrary data in the audio stream is dumb but about par for the course by Avisynth plugin coding standards. I'm pretty sure it's been done before by other plugins. You could serialize the data and put it in a script variable, but it's not really worth the effort.
TheFluff is offline