May 5, 2020, 11:29 by d...@lynne.ee: > May 5, 2020, 09:59 by andreas.rheinha...@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. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".