0

On our platform, the test case "18. MediaElementEvents" in "http://qual-e.appspot.com/ " fail due to "ended" can not be triggered in Cobalt

The following js code in conformanceTest-20170531180007.js:

media.addEventListener('ended', function() {
self.log('onended called');
runner.succeed();
});

I can not receive ended callback and test case will fail

The following C code in html_media_element.cc:

if (!SbDoubleIsNan(dur) && (0.0f != dur) && now >= dur && playback_rate_0)
{
     ......

     if(!sent_end_event)
     {
     send_end_event_ = true;
     ScheduleOwnEvent(base:Tokens::ended());
     }
     ......
 }

You can see that there is checking for "now >= dur" which may cause ended callback not be triggered anymore. Because platform may exist a tiny gap between the current time at EOS and duration. Take this test case as an example, "dur" is 1.000s, but "now" maybe stay 0.98ms on the platform at EOS.

(1) Now, Stardboard API can not receive duration from Cobalt. Duration is always -1. If Stardboard can pass duration to us, we can force current time at EOS equal to duration when notify "kSbPlayerStateEndOfStream" to Cobalt.

(2) Maybe remove the check "now >= dur" simply also fix this issue.

Could Cobalt fix this issue by the way (1) or (2)? Or do you have any other suggestion?

Thanks

2 Answers2

0

Which Cobalt version do you use? Some partners could pass this tests by modifying their implementation. You can refer up-to-date Cobalt open source implementation as it passes this test as well.

Daniel

  • Our Cobalt version is 11.62465 I check the media content in this test case , the largest audio pts cobalt send to us is 89861 and the largest video pts is 87480. I think the root cause of this issue maybe the "now>=dur" is too strict which do not consider the gap between the current time at EOS and duration. – jia wang Jun 20 '17 at 03:26
  • Hi, daniel, any suggestion? I still have this issue using latest Cobalt open source code. I have known that we also could do some workaround by modifying our implementation for passing this special test case, however, is it better to fix this issue on Cobalt side(maybe root cause for this issue)? – jia wang Jun 26 '17 at 02:04
  • When you mentioned that "now>=dur" is never true, what is the maximum value for "now" and what is the value of "dur" you observed? – xiaoming Jul 20 '17 at 00:14
  • Hi,xiaoming, sorry for late reply. Take this test case as an example, "dur" is 1.000s, but "now" maybe stay 0.98ms on the platform at EOS. – jia wang Jul 24 '17 at 01:44
  • You mentioned that the last audio pts is 89861, assume it is in 90khz time, the corresponding timestamp should be 0.998455s. The audio frame should also have a non-zero duration. The final media time should be the sum of the timestamp of the last audio frame and its duration, which should be greater than 1s. – xiaoming Jul 27 '17 at 02:26
  • jia wang, do you still fail this test case? – Daniel Juyung Seo Aug 16 '17 at 16:48
0

We are investigating this issue and it is very likely to be a bug in our code. We will keep you updated here for any progress.

xiaoming
  • 101
  • 2