diff options
author | wm4 <wm4@nowhere> | 2016-02-21 16:25:02 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-02-21 16:26:23 +0100 |
commit | 943f76e6ce979ce1e1e7e29e4e20f8ec56682df7 (patch) | |
tree | bb8c17c3bbeff0fd50cf7b270f694c73acfef4ed /demux/demux_mkv.c | |
parent | 3ca020856684b306f80e42ec5622586d35f36d91 (diff) | |
download | mpv-943f76e6ce979ce1e1e7e29e4e20f8ec56682df7.tar.bz2 mpv-943f76e6ce979ce1e1e7e29e4e20f8ec56682df7.tar.xz |
demux_mkv: add hack to fix opus gapless behavior
I think the conclusion is that AV_PKT_DATA_SKIP_SAMPLES is misdesigned
(at least for some formats), and an alternative mechanism using
durations would be better. (Combining it with a proper timebase would
keep sample-accuracy.)
Diffstat (limited to 'demux/demux_mkv.c')
-rw-r--r-- | demux/demux_mkv.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index 4eb4df260f..761985c204 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -1679,6 +1679,12 @@ static int demux_mkv_open_audio(demuxer_t *demuxer, mkv_track_t *track) AV_WL32(data + 10, track->a_osfreq); // Bogus: last frame won't be played. AV_WL32(data + 14, 0); + } else if (strcmp(codec, "opus")) { + // Hardcode the rate libavcodec's opus decoder outputs, so that + // AV_PKT_DATA_SKIP_SAMPLES actually works. The Matroska header only + // has an arbitrary "input" samplerate, while libavcodec is fixed to + // output 48000. + sh_a->samplerate = 48000; } // Some files have broken default DefaultDuration set, which will lead to |