Open Bug 1346156 Opened 7 years ago Updated 2 years ago

2nd last painted frame is shown when stalling

Categories

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

defect

Tracking

()

People

(Reporter: jya, Unassigned)

References

()

Details

(Keywords: regression, regressionwindow-wanted)

This can be seen with this test case:
https://people-mozilla.org/~jyavenard/tests/mse_mp4/1342913/t2.html

This video is made of 47 frames (from 0 to 46).

When you play the video, you can see that frame 46 is displayed only for 45 to be displayed again.

So there order displayed is:

0, 1, ..., 45, 46, 45

when it should be:
0, 1, ..., 45, 46
interestingly, about media shows that it appears things have moved backward:

https://people-mozilla.org/~jyavenard/tests/mse_mp4/1342913/t2.html
	blob:https://people-mozilla.org/bcdf98fd-c0f3-1641-b4c9-752144b39ba9
	currentTime: 1.623958 readyState: 2
	Quality: 100% (total:90 dropped:0 corrupted:0)
	Buffered ranges: [(0.095, 1.625396)]
		SourceBuffer 0
			start=0.095 end=1.625396

currentTime isn't the end time.

I wonder if this is related to the issue mentioned by amazon where currentTime was prior the duration and ended wasn't fired.
Flags: needinfo?(jwwang)
I am able to repro the issue on Mac. Let's see some logs:

[MediaPlayback #3]: D/MediaSample Decoder=0x121590c00 OnAudioDecoded [1578956,1625395]
[MediaPlayback #2]: D/MediaSample Decoder=0x121590c00 OnVideoDecoded [1596677,1630000]
[MediaPlayback #3]: D/MediaSample Decoder=0x121590c00 OnVideoDecoded [1630000,1663333]
[MediaPlayback #2]: D/MediaSample Decoder=0x121590c00 OnVideoDecoded [1663333,1696666]

The end time of last audio sample is 1625395 which is smaller than 1630000 which is the start time of the 2nd last video frame. Therefore, MDSM enters buffering (and pauses playback) for running out of audio without displaying the last video frame.
Flags: needinfo?(jwwang)
(In reply to Jean-Yves Avenard [:jya] from comment #0)
> This can be seen with this test case:
> https://people-mozilla.org/~jyavenard/tests/mse_mp4/1342913/t2.html
> 
> This video is made of 47 frames (from 0 to 46).
> 
> When you play the video, you can see that frame 46 is displayed only for 45
> to be displayed again.
> 
> So there order displayed is:
> 
> 0, 1, ..., 45, 46, 45

Are you sure '46' is ever displayed for the video frames flip so quickly?
yes, I'm sure..

I made a 120fps video using my iphone and played it slowly (mode is called slow mo) , it's very easy to see then.
See Also: → 1374548
I tested this issue using the test case from comment 0 with FF 51, 54, FF 55 beta and FF Nightly 56.0a1(2017-06-20) and I have the same result, the 45 is displayed at the end on all versions of FF that I used. 

Jean do you have any thoughts here? Thanks
Flags: needinfo?(jyavenard)
see bug 1374548, explanation is given on why it happens.
Flags: needinfo?(jyavenard)
are you certain you were using FF with the basic compositor? this issue was with this compositor, not the hardware accelerated ones (which are used by default on all platforms but linux)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.