[FFmpeg-devel] [PATCH] lavc/bsf: add an Opus metadata bitstream filter
Lynne
dev at lynne.ee
Wed May 6 00:27:07 EEST 2020
May 5, 2020, 11:29 by dev at lynne.ee:
> May 5, 2020, 09:59 by andreas.rheinhardt at gmail.com:
>
>> Lynne:
>>
>>> The only adjustable field is the gain. Some ripping/transcoding programs
>>> have started to use it for replaygain adjustments.
>>>
>>> Patch attached.
>>>
>>> >
>>> +typedef struct OpusBSFContext {
>>> + const AVClass *class;
>>> + int64_t gain;
>>> +} OpusBSFContext;
>>>
>> [...]
>>
>>>
>>> +static const AVOption opus_metadata_options[] = {
>>> + { "gain", "Gain, actual amplification is pow(10, gain/(20.0*256))", OFFSET(gain),
>>> + AV_OPT_TYPE_INT, { .i64 = 0 }, -(INT16_MAX + 1), INT16_MAX, .flags = FLAGS },
>>> +
>>> + { NULL },
>>> +};
>>>
>>
>> You are using an AV_OPT_TYPE_INT parameter, yet the actual type of the
>> destination is int64_t. This won't work on big endian systems. Make gain
>> an int.
>>
>
> Thanks, made it an int, patch attached.
>
>
>
>> PS: Do we actually support two's complement architectures were
>> -(INT16_MAX + 1) != INT16_MIN? (A two's complement architecture in which
>> the representation where the sign bit is set and all other bits is unset
>> is trap representation is legal according to the C standard. Does
>> someone know whether it would also be legal according to POSIX?)
>>
>
> I think we already rely on that pretty heavily in our code.
>
Pushed.
More information about the ffmpeg-devel
mailing list