aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utils.c
diff options
context:
space:
mode:
authorRoman Beranek <roman.beranek@prusa3d.cz>2021-07-10 03:10:06 +0200
committerLynne <dev@lynne.ee>2021-07-12 09:54:25 +0200
commited240db9e3122d4dccbd1bee7d12cd50a0edc807 (patch)
treef6d61825d5bf5b629aba26c0dc0315f6d594a990 /tests/utils.c
parent1aa9dcd091ed9cebf06c4c6a9c96ff80a54722f4 (diff)
downloadffmpeg-ed240db9e3122d4dccbd1bee7d12cd50a0edc807.tar.gz
cafenc: fill in avg. packet size later if unknown
Frame size of Opus stream was previously presumed here to be 960 samples (20ms), however sizes of 120, 240, 480, 1920, and 2880 are also allowed. It can also alter on a per-packet basis and even multiple frames may be present in a single packet according to the specification, for the sake of simplicity however, let us assume that this doesn't occur. Because the mFramesPerPacket field, representing the number of samples per packet in the ffmpeg terminilogy, is the key factor in calculating packet durations and all that follows from that (index, bitrate, ...), it is crucial to get right. Therefore, if the packet size is not available ahead of time (as it is in the case of Opus), calculate an average from the stream duration once we know how many packets there are and update the filed in the header.
Diffstat (limited to 'tests/utils.c')
0 files changed, 0 insertions, 0 deletions