mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +00:00
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:
parent
930b483a68
commit
fa767b6268
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user