{"action":"created","issue":{"url":"https://api.github.com/repos/google/ExoPlayer/issues/1039","labels_url":"https://api.github.com/repos/google/ExoPlayer/issues/1039/labels{/name}","comments_url":"https://api.github.com/repos/google/ExoPlayer/issues/1039/comments","events_url":"https://api.github.com/repos/google/ExoPlayer/issues/1039/events","html_url":"https://github.com/google/ExoPlayer/issues/1039","id":121311819,"number":1039,"title":"seekTo restarts playback in LibopusAudioTrackRenderer","user":{"login":"Brahmasmi","id":12775566,"avatar_url":"https://avatars.githubusercontent.com/u/12775566?v=3","gravatar_id":"","url":"https://api.github.com/users/Brahmasmi","html_url":"https://github.com/Brahmasmi","followers_url":"https://api.github.com/users/Brahmasmi/followers","following_url":"https://api.github.com/users/Brahmasmi/following{/other_user}","gists_url":"https://api.github.com/users/Brahmasmi/gists{/gist_id}","starred_url":"https://api.github.com/users/Brahmasmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brahmasmi/subscriptions","organizations_url":"https://api.github.com/users/Brahmasmi/orgs","repos_url":"https://api.github.com/users/Brahmasmi/repos","events_url":"https://api.github.com/users/Brahmasmi/events{/privacy}","received_events_url":"https://api.github.com/users/Brahmasmi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"vigneshvg","id":9002240,"avatar_url":"https://avatars.githubusercontent.com/u/9002240?v=3","gravatar_id":"","url":"https://api.github.com/users/vigneshvg","html_url":"https://github.com/vigneshvg","followers_url":"https://api.github.com/users/vigneshvg/followers","following_url":"https://api.github.com/users/vigneshvg/following{/other_user}","gists_url":"https://api.github.com/users/vigneshvg/gists{/gist_id}","starred_url":"https://api.github.com/users/vigneshvg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vigneshvg/subscriptions","organizations_url":"https://api.github.com/users/vigneshvg/orgs","repos_url":"https://api.github.com/users/vigneshvg/repos","events_url":"https://api.github.com/users/vigneshvg/events{/privacy}","received_events_url":"https://api.github.com/users/vigneshvg/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-12-09T18:41:16Z","updated_at":"2015-12-10T03:50:07Z","closed_at":"2015-12-10T03:50:07Z","body":"The ExoPlayer.seekTo function does not seem to work when playing an audio only file. It always ends up starting from the beginning of the audio file. The following cases have been tried:\r\n1) Seek before Start - Calling seekTo, and immediately setting playWhenReady to true.\r\n2) Seek after Start - Calling seekTo during an ongoing playback.\r\n\r\nIn both the cases, the playback restarts from the beginning.\r\n\r\nOne sample audio file has been transcoded using ffmpeg 2.8.3. Another audio file is from the chromium source (https://chromium.googlesource.com/chromium/src/+/master/media/test/data/bear-opus.webm). All sources are at current HEAD. The NDK version is r10e."},"comment":{"url":"https://api.github.com/repos/google/ExoPlayer/issues/comments/163478971","html_url":"https://github.com/google/ExoPlayer/issues/1039#issuecomment-163478971","issue_url":"https://api.github.com/repos/google/ExoPlayer/issues/1039","id":163478971,"user":{"login":"vigneshvg","id":9002240,"avatar_url":"https://avatars.githubusercontent.com/u/9002240?v=3","gravatar_id":"","url":"https://api.github.com/users/vigneshvg","html_url":"https://github.com/vigneshvg","followers_url":"https://api.github.com/users/vigneshvg/followers","following_url":"https://api.github.com/users/vigneshvg/following{/other_user}","gists_url":"https://api.github.com/users/vigneshvg/gists{/gist_id}","starred_url":"https://api.github.com/users/vigneshvg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vigneshvg/subscriptions","organizations_url":"https://api.github.com/users/vigneshvg/orgs","repos_url":"https://api.github.com/users/vigneshvg/repos","events_url":"https://api.github.com/users/vigneshvg/events{/privacy}","received_events_url":"https://api.github.com/users/vigneshvg/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T03:50:07Z","updated_at":"2015-12-10T03:50:07Z","body":"The file in the chromium source does not have Cues (seek index) and thus it is un-seekable (it is possible that the opus demo app isn't handling un-seekable files correctly - but i'll leave that out).\r\n\r\nFFmpeg does not write out Cues on audio only encodes. There are two workarounds here:\r\n1) Use the -dash 1 parameter in FFmpeg. This will ensure that Cues are written out (even for audio only encodes), but has some other implications (like when a Cluster is created, etc.)\r\n2) Encode the file using FFmpeg and then use sample_muxer from libwebm [1] with -cues_on_audio_track 1 to force Cues to be written on audio tracks.\r\n\r\nOnce you have Cues in your file, seeking will work as expected. Also note that this behavior has nothing to do with LibopusAudioTrackRenderer. This behavior is because of the way the Extractor handles Seeking. Please make sure you are using ExtractorSampleSource and not FrameworkSampleSource (because the latter only looks at Cues on video track [2]).\r\n\r\n[1] https://chromium.googlesource.com/webm/libwebm\r\n[2] http://androidxref.com/6.0.0_r1/xref/frameworks/av/media/libstagefright/matroska/MatroskaExtractor.cpp#455"}}