Closed
Bug 1290371
Opened 9 years ago
Closed 9 years ago
Assertion failure: (!HasAudio() || mAudio.mFirstDemuxedSampleTime.isSome()) && (!HasVideo() || mVideo.mFirstDemuxedSampleTime.isSome()), at dom/media/MediaFormatReader.cpp:1641
Categories
(Core :: Audio/Video: Playback, defect, P3)
Core
Audio/Video: Playback
Tracking
()
VERIFIED
FIXED
mozilla51
People
(Reporter: jya, Assigned: kaku)
References
()
Details
(Keywords: regression)
Attachments
(1 file, 1 obsolete file)
58 bytes,
text/x-review-board-request
|
jya
:
review+
ritu
:
approval-mozilla-aurora+
ritu
:
approval-mozilla-beta+
|
Details |
When playing a video which no video frame (but with a video track). Attempting to seek in the video will assert.
Assertion failure: (!HasAudio() || mAudio.mFirstDemuxedSampleTime.isSome()) && (!HasVideo() || mVideo.mFirstDemuxedSampleTime.isSome()), at /Users/jyavenard/Work/Mozilla/mozilla-central/dom/media/MediaFormatReader.cpp:1641
#01: mozilla::MediaFormatReader::DemuxStartTime()[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3d4ee41]
#02: mozilla::MediaFormatReader::SetSeekTarget(mozilla::SeekTarget const&)[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3d4eb9b]
#03: mozilla::MediaFormatReader::Seek(mozilla::SeekTarget, long long)[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3d4ea39]
#04: RefPtr<mozilla::MozPromise<mozilla::media::TimeUnit, nsresult, true> > mozilla::detail::MethodCallInvokeHelper<RefPtr<mozilla::MozPromise<mozilla::media::TimeUnit, nsresult, true> >, mozilla::MediaDecoderReader, mozilla::SeekTarget, long long, 0ul, 1ul>(R[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3d1a60f]
#05: mozilla::detail::MethodCall<mozilla::MozPromise<mozilla::media::TimeUnit, nsresult, true>, mozilla::MediaDecoderReader, mozilla::SeekTarget, long long>::Invoke()[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3d1a4de]
#06: mozilla::detail::ProxyRunnable<mozilla::MozPromise<mozilla::media::TimeUnit, nsresult, true>, mozilla::MediaDecoderReader, mozilla::SeekTarget, long long>::Run()[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0x3d1a2cf]
#07: mozilla::AutoTaskDispatcher::TaskGroupRunnable::Run()[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1bd385]
#08: mozilla::TaskQueue::Runner::Run()[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1a5fab]
#09: nsThreadPool::Run()[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1b229e]
#10: nsThread::ProcessNextEvent(bool, bool*)[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1aeae9]
#11: NS_ProcessNextEvent(nsIThread*, bool)[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0x239d1c]
#12: mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*)[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0xb94613]
#13: MessageLoop::RunInternal()[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0xa9ce65]
#14: MessageLoop::RunHandler()[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0xa9cdc5]
#15: MessageLoop::Run()[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0xa9cd6d]
#16: nsThread::ThreadFunc(void*)[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1ac3d8]
#17: _pt_root[/Users/jyavenard/Work/Mozilla/obj-ff-dbg/dist/NightlyDebug.app/Contents/MacOS/libnss3.dylib +0x359c6d]
#18: _pthread_body[/usr/lib/system/introspection/libsystem_pthread.dylib +0x3805]
#19: _pthread_body[/usr/lib/system/introspection/libsystem_pthread.dylib +0x3782]
(lldb)
STR:
1. go to https://people.mozilla.org/~jyavenard/tests/ogg/ogg-wrongduration4.html
2. Press play
3. When playback reach the end, press play again.
boom
Reporter | ||
Updated•9 years ago
|
Flags: needinfo?(kaku)
Reporter | ||
Updated•9 years ago
|
Updated•9 years ago
|
Priority: -- → P3
Assignee | ||
Comment 1•9 years ago
|
||
So, I think we should remove the assertions and modify the code here, http://searchfox.org/mozilla-central/source/dom/media/MediaFormatReader.cpp#1642, to be:
return std::min(HasAudio() && mAudio.mFirstDemuxedSampleTime.isSome()
? mAudio.mFirstDemuxedSampleTime.ref()
: TimeUnit::FromInfinity(),
HasVideo() && mVideo.mFirstDemuxedSampleTime.isSome()
? mVideo.mFirstDemuxedSampleTime.ref()
: TimeUnit::FromInfinity());
@jya, is it possible that a file has both audio and video tracks but cannot demux any audio/video data at all? If yes, then we should also return 0 for this special case.
BTW, this issue cannot be reproduced at the codecase around three weeks ago; I think it's before this chage:https://hg.mozilla.org/mozilla-central/diff/8577afd12830/dom/media/ogg/OggDecoder.cpp
Before that changeset, it seems that some video frames could be decoded, the video element does show something on the screen.
Flags: needinfo?(kaku) → needinfo?(jyavenard)
Reporter | ||
Comment 2•9 years ago
|
||
(In reply to Tzuhao Kuo [:kaku] from comment #1)
> @jya, is it possible that a file has both audio and video tracks but cannot
> demux any audio/video data at all? If yes, then we should also return 0 for
> this special case.
yes that is possible with a file that is made of only the metadata.
There's a few files like this in the mochitest (ogg files), and I've also seen such files with mp4.
>
> BTW, this issue cannot be reproduced at the codecase around three weeks ago;
> I think it's before this
> chage:https://hg.mozilla.org/mozilla-central/diff/8577afd12830/dom/media/ogg/
> OggDecoder.cpp
that could be because you've haven't used a file with the problem. but there are definitely some out there.
So maybe we should mark this bug as regression, and ensure the fix goes in 49 too (or 50?)
Flags: needinfo?(jyavenard)
Reporter | ||
Updated•9 years ago
|
status-firefox49:
--- → affected
status-firefox50:
--- → affected
Assignee | ||
Comment 3•9 years ago
|
||
(In reply to Jean-Yves Avenard [:jya] from comment #2)
> (In reply to Tzuhao Kuo [:kaku] from comment #1)
> > @jya, is it possible that a file has both audio and video tracks but cannot
> > demux any audio/video data at all? If yes, then we should also return 0 for
> > this special case.
>
> yes that is possible with a file that is made of only the metadata.
Then I will return 0 for this special case which means do not modify the seek target at all.
> > BTW, this issue cannot be reproduced at the codecase around three weeks ago;
> > I think it's before this
> > chage:https://hg.mozilla.org/mozilla-central/diff/8577afd12830/dom/media/ogg/
> > OggDecoder.cpp
>
> that could be because you've haven't used a file with the problem. but there
> are definitely some out there.
Yup, this is definitely a bug and I should fix it.
> So maybe we should mark this bug as regression, and ensure the fix goes in 49 too (or 50?)
Not sure, the regression is the original framework was able to decode video frame but not now, which is not the root cause of this bug. So, I think another bug to point out regression is better.
Updated•9 years ago
|
Version: unspecified → Trunk
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → kaku
Assignee | ||
Comment 4•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/68534/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/68534/
Attachment #8776873 -
Flags: review?(jyavenard)
Assignee | ||
Comment 5•9 years ago
|
||
Comment 6•9 years ago
|
||
https://reviewboard.mozilla.org/r/68534/#review65628
::: dom/media/MediaFormatReader.cpp:1663
(Diff revision 1)
> - : TimeUnit::FromInfinity(),
> - HasVideo()
> - ? mVideo.mFirstDemuxedSampleTime.ref()
> - : TimeUnit::FromInfinity());
> +
> + if (HasAudio()) {
> + if (mAudio.mFirstDemuxedSampleTime.isSome()) {
> + audioStartTime = mAudio.mFirstDemuxedSampleTime.ref();
> + } else {
> + audioStartTime = TimeUnit::FromMicroseconds(0);
We can't assume start time is 0 when there is no sample at all in the track.
Reporter | ||
Comment 7•9 years ago
|
||
Comment on attachment 8776873 [details]
Bug 1290371 - handle files with audio and video tracks but no samples at all;
https://reviewboard.mozilla.org/r/68534/#review65636
::: dom/media/MediaFormatReader.cpp:1663
(Diff revision 1)
> - : TimeUnit::FromInfinity(),
> - HasVideo()
> - ? mVideo.mFirstDemuxedSampleTime.ref()
> - : TimeUnit::FromInfinity());
> +
> + if (HasAudio()) {
> + if (mAudio.mFirstDemuxedSampleTime.isSome()) {
> + audioStartTime = mAudio.mFirstDemuxedSampleTime.ref();
> + } else {
> + audioStartTime = TimeUnit::FromMicroseconds(0);
If you have no audio frame, then it shouldn't come into the calculation and must be ignored.
::: dom/media/MediaFormatReader.cpp:1667
(Diff revision 1)
> + } else {
> + audioStartTime = TimeUnit::FromMicroseconds(0);
> + }
> + }
> +
> + if (HasVideo()) {
same for video.
Attachment #8776873 -
Flags: review?(jyavenard) → review-
Updated•9 years ago
|
status-firefox48:
--- → unaffected
status-firefox51:
--- → affected
Assignee | ||
Comment 8•9 years ago
|
||
So, we have 4 boolean variables and here is the truth table.
Case 1, 2, 3, 4, 7, 8, 10 and 12 are not possible to happen.
Then, the remaining cases could be clustered into three categories:
(1) Case 5, 9 and 13: no sample is demuxed at all, return 0.
(2) Case 6, 11, 14 and 15: either audio or video is able to be demuxed, return the known value.
(3) Case 15: both audio and video are demuxed, return the minimum of the values.
For simplifying the logic, I will initialize the audioStartTime and videoStartTime
to be INFINITY if we don't have the first-demuxed sample, otherwise, initialize
them to be the real first-demuxed sample's time.
Then, the final calculation will be:
(1) Case 5, 9 and 13: the minimum of two INFINITY values is still INFINITY, return 0.
(2) Case 6, 11, 14 and 15: return the minimum of one real first-demuxed-time and the INFINITY.
(3) Case 15: return the minimum of two real first-demuxed-time values.
Case HasAudio HasVideo HasAudioSample HasVideoSample ExpectedResult
---------------------------------------------------------------------------------------------------
1 F F F F not possible
2 F F F T not possible
3 F F T F not possible
4 F F T T not possible
---------------------------------------------------------------------------------------------------
5 F T F F return 0
6 F T F T return video sample
7 F T T F not possible
8 F T T T not possible
---------------------------------------------------------------------------------------------------
9 T F F F return 0
10 T F F T not possible
11 T F T F return audio sample
12 T F T T not possible
---------------------------------------------------------------------------------------------------
13 T T F F return 0
14 T T F T return videoSample
15 T T T F return audioSample
16 T T T T return min(auidoSample, videoSample)
Review commit: https://reviewboard.mozilla.org/r/68850/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/68850/
Attachment #8777294 -
Flags: review?(jyavenard)
Assignee | ||
Updated•9 years ago
|
Attachment #8776873 -
Attachment is obsolete: true
Reporter | ||
Updated•9 years ago
|
Attachment #8777294 -
Flags: review?(jyavenard) → review+
Reporter | ||
Comment 9•9 years ago
|
||
Comment on attachment 8777294 [details]
Bug 1290371 - handle files with audio and video tracks but no samples at all;
https://reviewboard.mozilla.org/r/68850/#review66288
::: dom/media/MediaFormatReader.cpp:1659
(Diff revision 1)
> - MOZ_ASSERT((!HasAudio() || mAudio.mFirstDemuxedSampleTime.isSome()) &&
> + MOZ_ASSERT(HasAudio() || HasVideo());
> - (!HasVideo() || mVideo.mFirstDemuxedSampleTime.isSome()));
>
> - return std::min(HasAudio()
> + const TimeUnit startTime =
> + std::min(HasAudio() && mAudio.mFirstDemuxedSampleTime.isSome()
> - ? mAudio.mFirstDemuxedSampleTime.ref()
> + ? mAudio.mFirstDemuxedSampleTime.ref()
you could use mFirstDemuxedSampleTime.refOr(TimeUnit::FromInfinity()) instead
Assignee | ||
Comment 10•9 years ago
|
||
Comment on attachment 8777294 [details]
Bug 1290371 - handle files with audio and video tracks but no samples at all;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/68850/diff/1-2/
Assignee | ||
Comment 11•9 years ago
|
||
Comment 13•9 years ago
|
||
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f3e511763961
handle files with audio and video tracks but no samples at all; r=jya
Keywords: checkin-needed
Comment 15•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Comment 16•9 years ago
|
||
note a real live website where this assertion is http://www.fonlabeni.com/ found via bughunter
tracking-firefox49:
--- → ?
tracking-firefox50:
--- → ?
Comment 17•9 years ago
|
||
(In reply to Carsten Book [:Tomcat] from comment #16)
> note a real live website where this assertion is http://www.fonlabeni.com/
> found via bughunter
btw also verified fixed this assertion with the latest m-c build
Assignee | ||
Comment 18•9 years ago
|
||
(In reply to Carsten Book [:Tomcat] from comment #17)
> btw also verified fixed this assertion with the latest m-c build
Thanks for the verification!
Reporter | ||
Comment 20•9 years ago
|
||
Comment on attachment 8777294 [details]
Bug 1290371 - handle files with audio and video tracks but no samples at all;
Approval Request Comment
[Feature/regressing bug #]:1272267
[User impact if declined]:Assertions
[Describe test coverage new/current, TreeHerder]: In central, manual test. Verified
[Risks and why]: none
[String/UUID change made/needed]: none
Flags: needinfo?(jyavenard)
Attachment #8777294 -
Flags: approval-mozilla-beta?
Attachment #8777294 -
Flags: approval-mozilla-aurora?
Tracked for 50 and 51 as it's a regression. Marking it verified for 51 based on comment 17.
Status: RESOLVED → VERIFIED
Comment on attachment 8777294 [details]
Bug 1290371 - handle files with audio and video tracks but no samples at all;
Fixed a bug in AV playback on some sites, verified on Nightly, Beta49+, Aurora50+
Attachment #8777294 -
Flags: approval-mozilla-beta?
Attachment #8777294 -
Flags: approval-mozilla-beta+
Attachment #8777294 -
Flags: approval-mozilla-aurora?
Attachment #8777294 -
Flags: approval-mozilla-aurora+
Comment 23•9 years ago
|
||
bugherder uplift |
Comment 24•9 years ago
|
||
bugherder uplift |
You need to log in
before you can comment on or make changes to this bug.
Description
•