14-17 Data length in samples (binary, Little Endian) This has been validated with sample generated with: ffmpeg -i $(ffmpeg_fate)/lossless-audio/luckynight-partial.tak -c:a tta lucky.mka The length is correctly calculated to be 418950 for that sample. Basically this is a port of https://github.com/FFmpeg/FFmpeg/commit/af248fa1174200acb537a6ab1198bb2fed38e884
Unified · Split
| @@ -2092,8 +2092,8 @@ static int demux_mkv_open_audio(demuxer_t *demuxer, mkv_track_t *track) · 2091 unmodified lines | ||
| 2092 | 2092 | AV_WL16(data + 6, sh_a->channels.num); |
| 2093 | 2093 | AV_WL16(data + 8, sh_a->bits_per_coded_sample); |
| 2094 | 2094 | AV_WL32(data + 10, track->a_osfreq); |
| 2095 | − // Bogus: last frame won't be played. | |
| 2096 | − AV_WL32(data + 14, 0); | |
| 2095 | + mkv_demuxer_t *mkv_d = demuxer->priv; | |
| 2096 | + AV_WL32(data + 14, mkv_d->duration * track->a_osfreq); | |
| 2097 | 2097 | } else if (!strcmp(codec, "opus")) { |
| 2098 | 2098 | // Hardcode the rate libavcodec's opus decoder outputs, so that |
| 2099 | 2099 | // AV_PKT_DATA_SKIP_SAMPLES actually works. The Matroska header only |