From af8be7bf437ebeb10911ba30c8cf696a0da9657c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 24 Apr 2023 10:55:43 +0200 Subject: lavf/dauddec: set timebase to 1/samplerate Prevents lavf from generating inexact timestamps with the default timebase of 1/90000. --- libavformat/dauddec.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libavformat') diff --git a/libavformat/dauddec.c b/libavformat/dauddec.c index 0cbf7e4e36..7e411091ec 100644 --- a/libavformat/dauddec.c +++ b/libavformat/dauddec.c @@ -21,6 +21,7 @@ #include "libavutil/channel_layout.h" #include "avformat.h" +#include "internal.h" static int daud_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); @@ -34,6 +35,9 @@ static int daud_header(AVFormatContext *s) { st->codecpar->bit_rate = 3 * 6 * 96000 * 8; st->codecpar->block_align = 3 * 6; st->codecpar->bits_per_coded_sample = 24; + + avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); + return 0; } -- cgit v1.2.1