You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is reproducible on ms01ltezh running JLS36C. The cause seems to be that the decoder outputs a final buffer with the end-of-stream flag set and timestamp 0. The default audio sink interprets this timestamp as a position discontinuity and adjusts its start media time, which in turn leads to the player position becoming negative. I'll see if there's a workaround to fix the erroneous output buffer info.
OsVersion==4.4.4 PhoneVersion==SM-G7200
{e.printStackTrace(); }
ExoPlayer version: v2.9.0
The sample code is :
DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
TrackSelection.Factory selectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
TrackSelector trackSelector = new DefaultTrackSelector(selectionFactory);
mCurrentPlayer = ExoPlayerFactory.newSimpleInstance(TestActivity.this, trackSelector);
PlaybackParameters playbackParameters = new PlaybackParameters(1.0f, 1.0F);
mCurrentPlayer.setPlaybackParameters(playbackParameters);
try {
String url = "http://ep.dzb.ciwong.com/rep/38F79B83_E117_4727_A541_7642C18801CD.mp3";
mCurrentPlayer.prepare(getMediaSource(url)); mCurrentPlayer.addListener(mEventListener);
mCurrentPlayer.setPlayWhenReady(true);
} catch (Exception e)
private BaseMediaSource getMediaSource(String url)
{ BaseMediaSource mediaSource = null; try { DefaultDataSourceFactory defaultDataSourceFactory = new DefaultDataSourceFactory(DemoApplication.getInstance(), Util.getUserAgent(DemoApplication.getInstance(), DemoApplication.getInstance().getString(R.string.application_name))); mediaSource = new ExtractorMediaSource(Uri.parse(url), defaultDataSourceFactory, new DefaultExtractorsFactory(), null, null); } catch (Exception e) { e.printStackTrace(); } return mediaSource; }
protected void playListener() {
if (mCurrentPlayer != null && mCurrentPlayer.getPlaybackState() == Player.STATE_READY
&& mCurrentPlayer.getPlayWhenReady()) {
Log.e(TAG, "getDuration ==" + (long) mCurrentPlayer.getDuration()
+ " getCurrentPosition ==" + (long) mCurrentPlayer.getCurrentPosition()
+" getCurrentWindowIndex ==" + (long)
mCurrentPlayer.getCurrentWindowIndex());
mHandler.postDelayed(new Runnable() {
public void run() {
playListener();
}
}, 200L);
}
``
38F79B83_E117_4727_A541_7642C18801CD.zip
}``
the log when play the mp3
getDuration ==1645 getCurrentPosition ==71
getDuration ==1645 getCurrentPosition ==71
getDuration ==1645 getCurrentPosition ==526
getDuration ==1645 getCurrentPosition ==728
getDuration ==1645 getCurrentPosition ==930
getDuration ==1645 getCurrentPosition ==1124
getDuration ==1645 getCurrentPosition ==-307
getDuration ==1645 getCurrentPosition ==-102
getDuration ==1645 getCurrentPosition ==100
getDuration ==1645 getCurrentPosition ==301
getDuration ==1645 getCurrentPosition ==493
getDuration ==1645 getCurrentPosition ==696
getDuration ==1645 getCurrentPosition ==900
getDuration ==1645 getCurrentPosition ==1103
getDuration ==1645 getCurrentPosition ==1295
getDuration ==1645 getCurrentPosition ==1498
The text was updated successfully, but these errors were encountered: