diff --git a/lib/media/media_source_engine.js b/lib/media/media_source_engine.js index f37a615900..102282999b 100644 --- a/lib/media/media_source_engine.js +++ b/lib/media/media_source_engine.js @@ -1233,7 +1233,16 @@ shaka.media.MediaSourceEngine = class { this.audioCompensation_.resolve(compensation); } } - const calculatedTimestampOffset = reference.startTime - timestamp; + let realTimestamp = timestamp; + const RAW_FORMATS = shaka.util.MimeUtils.RAW_FORMATS; + // For formats without containers and using segments mode, we need to + // adjust TimestampOffset relative to 0 because segments do not have + // any timestamp information. + if (!this.sequenceMode_ && + RAW_FORMATS.includes(this.sourceBufferTypes_[contentType])) { + realTimestamp = 0; + } + const calculatedTimestampOffset = reference.startTime - realTimestamp; const timestampOffsetDifference = Math.abs(timestampOffset - calculatedTimestampOffset); if ((timestampOffsetDifference >= 0.001 || seeked || adaptation) && diff --git a/test/transmuxer/transmuxer_integration.js b/test/transmuxer/transmuxer_integration.js index 3b5806058d..56a198adc5 100644 --- a/test/transmuxer/transmuxer_integration.js +++ b/test/transmuxer/transmuxer_integration.js @@ -76,8 +76,13 @@ describe('Transmuxer Player', () => { }); it('raw MP3', async () => { - if (!await Util.isTypeSupported('audio/mp4; codecs="mp3"')) { - pending('Codec MP3 in MP4 is not supported by the platform.'); + if (!await Util.isTypeSupported('audio/mp4; codecs="mp3"') && + !await Util.isTypeSupported('audio/mpeg')) { + pending('Codec MP3 is not supported by the platform.'); + } + // This tests is flaky in some Tizen devices, so we need omit it for now. + if (shaka.util.Platform.isTizen()) { + pending('Disabled on Tizen.'); } await player.load('/base/test/test/assets/hls-raw-mp3/playlist.m3u8'); await video.play(); @@ -173,7 +178,7 @@ describe('Transmuxer Player', () => { } // This tests is flaky in some Tizen devices, so we need omit it for now. if (shaka.util.Platform.isTizen()) { - return; + pending('Disabled on Tizen.'); } await player.load('/base/test/test/assets/hls-ts-mp3/manifest.m3u8'); await video.play(); @@ -377,8 +382,9 @@ describe('Transmuxer Player', () => { !await Util.isTypeSupported('audio/mpeg')) { pending('Codec MP3 is not supported by the platform.'); } - if (!shaka.util.Platform.supportsSequenceMode()) { - pending('Sequence mode is not supported by the platform.'); + // This tests is flaky in some Tizen devices, so we need omit it for now. + if (shaka.util.Platform.isTizen()) { + pending('Disabled on Tizen.'); } // eslint-disable-next-line max-len