Closed Bug 1242845 Opened 8 years ago Closed 8 years ago

Make the computation of MediaDecoderStateMachine::HasLowUndecodedData() more accurate and consistent

Categories

(Core :: Audio/Video: Playback, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: jwwang, Assigned: jwwang)

Details

Attachments

(1 file)

We should reference mDecodedVideoEndTime when calculating endOfDecodedVideoData to be consistent with the calculation of endOfDecodedAudioData. Also we should check {Audio,Video}Queue().IsFinished() instead of AtEndOfStream() since we won't be low in un-decoded data once all audio/video frames are decoded.
Comment on attachment 8712011 [details]
MozReview Request: Bug 1242845 - Make the computation of MediaDecoderStateMachine::HasLowUndecodedData() more accurate and consistent. r=jya.

https://reviewboard.mozilla.org/r/32405/#review29255

::: dom/media/MediaDecoderStateMachine.cpp:1882
(Diff revision 1)
> -  int64_t endOfDecodedAudioData = INT64_MAX;
> +                                  INT64_MAX;

I would prefer to avoid doubt by adding parenthesis around the test, and change the formatting like so:

int64_t endOfDecodedVideoData =
  (HasVideo() && !VideoQueue().IsFinished())
    ? mDecodedVideoEndTime
    : INT64_MAX;
    
as this is what we commonly use thorough the media code.
Attachment #8712011 - Flags: review?(jyavenard) → review+
https://reviewboard.mozilla.org/r/32405/#review29255

> I would prefer to avoid doubt by adding parenthesis around the test, and change the formatting like so:
> 
> int64_t endOfDecodedVideoData =
>   (HasVideo() && !VideoQueue().IsFinished())
>     ? mDecodedVideoEndTime
>     : INT64_MAX;
>     
> as this is what we commonly use thorough the media code.

Will make changes as suggested. Thanks for the review.
(In reply to JW Wang [:jwwang] from comment #4)
> https://reviewboard.mozilla.org/r/32405/#review29255
> 
> > I would prefer to avoid doubt by adding parenthesis around the test, and change the formatting like so:
> > 
> > int64_t endOfDecodedVideoData =
> >   (HasVideo() && !VideoQueue().IsFinished())
> >     ? mDecodedVideoEndTime
> >     : INT64_MAX;
> >     
> > as this is what we commonly use thorough the media code.
> 
> Will make changes as suggested. Thanks for the review.

you didn't :(

rather disappointed.
The changeset is here:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b4eb8810725e

Isn't this what you want?
OK, I see. You want '?' and ':' in the front of the line instead of the back.
https://hg.mozilla.org/mozilla-central/rev/b4eb8810725e
https://hg.mozilla.org/mozilla-central/rev/a282f57d22b6
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: