question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HLS/MP3: SeekTo does not seek to exact location

See original GitHub issue

[REQUIRED] Issue description

Calling seekTo when playing from an HLS playlist does not always seek to the exact location. After calling seekTo, playback appears to begin at the beginning of the playlist chunk containing the requested location. From the docs, it appears that exact seeking should be supported.

[REQUIRED] Reproduction steps

  1. Load the playlist into the sample player
  2. Seek from the beginning to (e.g.) 270757ms (I accomplished this by hardcoding the seek location into PlayerControlView.seekToTimeBarPosition)
  3. Playback resumes at approximately 240047ms
  4. Once the playhead is within the current chunk, seeking to that location behaves as expected.

[REQUIRED] Link to test content

Sample playlist has been sent to the dev.exoplayer email.

[REQUIRED] A full bug report captured from the device

Bug report has been sent with the sample playlist.

[REQUIRED] Version of ExoPlayer being used

I have reproduced this on 2.9.4 and 2.10

[REQUIRED] Device(s) and version(s) of Android being used

I am currently using a Pixel 3 running Android 9. We’ve had a couple instances of it happening on a Pixel 1 running 9 as well, but less frequently. I’ve been thus far unable to reproduce it on an emulator.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:26 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
ojw28commented, Jul 15, 2019

I’ve filed an internal bug about this [Internal ref: 137524007]. The problem is that the MP3 decoder on affected devices is adjusting buffer presentation timestamps in a way that we don’t expect.

That said, it may be possible (and a good idea) for us to adjust the way we’re handling this type of seeking so that the implementation is not sensitive to these types of decoder adjustment.

We currently associate a decodeOnly flag with each buffer, and we pass these flags around the side of the decoder as metadata, using the buffer timestamp as the key. Hence any modifications to the buffer timestamps by the decoder prevent correct re-association of the metadata on the output side. A simpler (but less flexible) alternative is to have the renderer know what the seek position is, and apply decodeOnly too all buffers up to the one immediately proceeding that position.

0reactions
ojw28commented, Mar 23, 2020

@kschults - We’re getting around to implementing a better fix for this. Would it be possible for you to send us another test stream, so we can make sure the final fix still works properly? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

HLS Streaming seekto not working on android 3.0+
I have problem seeking into live hls stream. When I call getCurrentPosition on videoview it returns 40 000, but when I try to...
Read more >
Deep Understanding of Seek - Taku Semba - Medium
It basically means that even if you want to seek to 10s, you are not able to seek to exact 10s unless there...
Read more >
MCT 文档
应码率HLS; MP3为MP3音频容器;M4A为MPEG4音频容器。 模板描述 ... completed and try again. ... Delogo (去水印) is not supported if preset is.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found