avdevice/oss_dec: account for sample size when computing timestamp

Don't assume each sample is one byte in size. Doing so results in wrong and
occasionally non-monotonically-increasing timestamps.

Fix nearby cosmetic typo.

Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Matt Jacobson
2022-06-01 05:06:16 -04:00
committed by Marton Balint
parent fee765c207
commit b3e261bab3
3 changed files with 5 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ typedef struct OSSAudioData {
AVClass *class;
int fd;
int sample_rate;
int sample_size; /* in bytes ! */
int channels;
int frame_size; /* in bytes ! */
enum AVCodecID codec_id;