demux_mkv: enable AVCodec parser timestamp usage for parsed audio

Without this, cases where the parser cannot return data right away
will end up utilizing the following fed packet's timestamps. This
will in turn cause an unnecessary offset in the audio stream
timestamps.

An example of such buffered parser in libavcodec is the EAC3 one.
This commit is contained in:
Dan Oscarsson 2021-06-27 10:11:57 +02:00 committed by Jan Ekström
parent 930b483a68
commit fa767b6268
1 changed files with 4 additions and 0 deletions

View File

@ -1741,7 +1741,11 @@ static int demux_mkv_open_audio(demuxer_t *demuxer, mkv_track_t *track)
if (!strcmp(codec, "mp2") || !strcmp(codec, "mp3") ||
!strcmp(codec, "truehd") || !strcmp(codec, "eac3"))
{
mkv_demuxer_t *mkv_d = demuxer->priv;
int64_t segment_timebase = (1e9 / mkv_d->tc_scale);
track->parse = true;
track->parse_timebase = MPMAX(sh_a->samplerate, segment_timebase);
} else if (!strcmp(codec, "flac")) {
unsigned char *ptr = extradata;
unsigned int size = extradata_len;