Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream request results in multiple requests #1041

Closed
juliusspencer opened this issue Dec 10, 2015 · 6 comments
Closed

Stream request results in multiple requests #1041

juliusspencer opened this issue Dec 10, 2015 · 6 comments
Labels

Comments

@juliusspencer
Copy link

Description

When the ExoPlayer is used to play certain audio files by streaming them from the network, the ExoPlayer makes 2 attempts to retrieve the file at varying byte offsets before commencing playback.

Steps to reproduce the problem from the demo application:

  1. Install the demo application
  2. Select Google Play (MP3 Audio)

Details
One execution of the example above, connected over wifi on a Nexus 6P, produced the following network requests:

GET /exoplayer-test-media-0/play.mp3 HTTP/1.1
User-Agent ExoPlayerDemo/1.5.2 (Linux;Android 6.0.1) ExoPlayerLib/1.5.2
Accept-Encoding identity
Host storage.googleapis.com
Connection Keep-Alive

GET /exoplayer-test-media-0/play.mp3 HTTP/1.1
Range bytes=313-
User-Agent ExoPlayerDemo/1.5.2 (Linux;Android 6.0.1) ExoPlayerLib/1.5.2
Accept-Encoding identity
Host storage.googleapis.com
Connection Keep-Alive

Expected behaviour
Only a single network request is made by the ExoPlayer.

Notes
We encounter this problem with AAC/MP4 files as well.

When we test this file (/exoplayer-test-media-0/play.mp3) with the Android MediaPlayer, it loads in one request.

GET /exoplayer-test-media-0/play.mp3 HTTP/1.1
User-Agent stagefright/1.2 (Linux;Android 5.0.2)
Host storage.googleapis.com
Connection Keep-Alive
Accept-Encoding gzip

@ojw28 ojw28 added the bug label Dec 10, 2015
@ojw28
Copy link
Contributor

ojw28 commented Dec 10, 2015

Yes, this is a known sub-optimality related to how stream selection works in ExtractorSampleSource at the moment. We plan on fixing it.

@juliusspencer
Copy link
Author

Thanks for the quick response, can we expect this behaviour for all tracks (MP3, AAC etc) or just some?

@ojw28
Copy link
Contributor

ojw28 commented Dec 10, 2015

I believe this currently happens for all container media types. It does not occur for DASH or SmoothStreaming playbacks.

@swxch1985
Copy link

Will you have the plan to fix this issue?

@ojw28
Copy link
Contributor

ojw28 commented Mar 16, 2016

We're currently working on a 2.0 version of ExoPlayer, in which this issue will be fixed. We do not have an ETA as of now.

ojw28 added a commit that referenced this issue Jun 15, 2016
…s" state.

1. SampleSource now has an explicit track selection state. This state is entered
   after the source is prepared, and also by calling startTrackSelection.
2. endTrackSelection commits selection changes, and is responsible for doing the
   right thing w.r.t starting/stopping/restarting load operations.
3. All sources now start or restart a load in the case of a new track selection.
   This fixes a problem where a source could be advanced by repeatedly disabling
   and re-enabling whilst paused. Some sources didn't restart a load in this case,
   since the position was unchanged, however the downstream renderer would then
   consume media up to the first keyframe in order to render something. Hence
   each disable/re-enable would advance by a keyframe.
4. This change will enable a subsequent change where we'll discard media for
   non-selected tracks earlier than we do currently (i.e. we'll hook the extractor
   to a dummy track output, so the samples will never be written to a rolling
   buffer). This will enable a further subsequent change where buffer contributions
   are per-renderer rather than per-source.

Issue: #1041
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118024436
@ojw28
Copy link
Contributor

ojw28 commented Jun 19, 2016

This is fixed in the 2.x.x experimental branch.

@ojw28 ojw28 closed this as completed Aug 8, 2016
@google google locked and limited conversation to collaborators Jun 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants