New issue
Advanced search Search tips

Issue 773911 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Consistently use base::TimeDelta for media duration

Project Member Reported by x...@chromium.org, Oct 12 2017

Issue description

Currently WMPI::Duration() and ChunkDemuxer::GetDuration() return doubles for the media duration, while PipelineController::GetMediaDuration() returns base::TimeDelta for the media duration. It makes sense to use base::TimeDelta() for media duration anywhere if possible.
 
sgtm, we had to do this in the past since blink couldn't use base/,
I tried to fix this issue, but found this comment:
double WebMediaPlayerImpl::Duration() const {
  // Use duration from ChunkDemuxer when present. MSE allows users to specify
  // duration as a double. This propagates to the rest of the pipeline as a
  // TimeDelta with potentially reduced precision (limited to Microseconds).
  // ChunkDemuxer returns the full-precision user-specified double. This ensures
  // users can "get" the exact duration they "set".
  if (chunk_demuxer_)
    return chunk_demuxer_->GetDuration();

it seems the full-precision of user-specified duration is necessary,
so I think maybe keep ChunkDemuxer returns double is better.

And HTMLMediaElement and MediaSource must return double according to IDL,
so WMPI must return double too, then the "fix" will look like just moving 
conversion between TimeDelta and double from ChunkDemuxer to WMPI.
Status: Assigned (was: Available)
Cc: -xhw...@chromium.org
Owner: ----
Status: Available (was: Assigned)
Cc: xhw...@chromium.org

Sign in to add a comment