diff options
author | Dan Oscarsson <DanOscarsson@users.noreply.github.com> | 2021-06-27 10:11:57 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2021-09-21 01:28:26 +0300 |
commit | fa767b626859cb2e4fbbc29f0b308d3638c10149 (patch) | |
tree | c9e3090908a1f7f500637bdf7e78f5d405d1e3c3 | |
parent | 930b483a6842128c669cad5dc9b2cb548d5f001f (diff) | |
download | mpv-fa767b626859cb2e4fbbc29f0b308d3638c10149.tar.bz2 mpv-fa767b626859cb2e4fbbc29f0b308d3638c10149.tar.xz |
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.
-rw-r--r-- | demux/demux_mkv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index 2e03fac874..d07f8fe1e0 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -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; |