AudioFormat: use av_get_bytes_per_sample instead of hardcoded size

Change-Id: I915fe38db6547425cdccc516d05ebd9afcdb3aac
This commit is contained in:
Adrien Beraud
2023-03-07 18:11:30 -05:00
committed by Adrien Béraud
parent e6a861249a
commit e73fbc9630

View File

@ -73,7 +73,7 @@ struct AudioFormat
/**
* Returns bytes necessary to hold one frame of audio data.
*/
inline size_t getBytesPerFrame() const { return sizeof(AudioSample) * nb_channels; }
inline size_t getBytesPerFrame() const { return av_get_bytes_per_sample(sampleFormat) * nb_channels; }
/**
* Bytes per second (default), or bytes necessary