Closed Bug 1194612 Opened 9 years ago Closed 9 years ago

AVC3 H264 is broken on mac

Categories

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

Unspecified
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: jya, Assigned: jya)

References

Details

Attachments

(4 files, 1 obsolete file)

This is a regression due to bug 1146086.

When using AVC3, we can't immediately initialize the H264 decoder until a SPS has been seen.

However, the H264Wrapper will immediately reject the init promise. This is wrong.

The init promise logic is broken...
A decoder isn't created until a SPS and PPS NALs have been detected in the stream. The decoder will be initialised instead lazily later during the input process.
Attachment #8647948 - Flags: review?(ayang)
There is another problem with the H264Converter; the first frame is dropped when the decoder is initialised which causes error when attempting to decode the frame
Assignee: nobody → jyavenard
It would cause the Apple VT decoder to fail decoding the frame, aborting playback
The initialisation promise rather than being launched on the reader's task queue, would be run on a task queue's specific thread
We ended up with a race between two threads owned by the same task queue. Fun.
Attachment #8648005 - Flags: review?(ayang)
Attachment #8648006 - Flags: review?(ayang)
Attachment #8648004 - Flags: review?(ayang)
The initialisation promise rather than being launched on the reader's task queue, would be run on a task queue's specific thread
We ended up with a race between two threads owned by the same task queue. Fun.
Attachment #8648008 - Flags: review?(ayang)
Attachment #8648005 - Attachment is obsolete: true
Attachment #8648005 - Flags: review?(ayang)
Comment on attachment 8647948 [details] [diff] [review]
P1. Dont reject init promise when initialising H264Converter.

Review of attachment 8647948 [details] [diff] [review]:
-----------------------------------------------------------------

I thought I've tried all the cases, obviously not. Sorry for this regression.
Attachment #8647948 - Flags: review?(ayang) → review+
Attachment #8648004 - Flags: review?(ayang) → review+
Attachment #8648006 - Flags: review?(ayang) → review+
Comment on attachment 8648008 [details] [diff] [review]
P3. Make H264Converter thread safe.

Review of attachment 8648008 [details] [diff] [review]:
-----------------------------------------------------------------

Maybe we don't need to add ReaderTaskQueue() in callback. Task queue can be retrieved from AbstractThread::GetCurrent()->AsTaskQueue(), for example in [1].


[1] https://dxr.mozilla.org/mozilla-central/rev/38c1ea9ccae31700630f1fe0d651e94c0c5b9e1d/dom/media/MediaDecoderStateMachine.cpp#1722
Attachment #8648008 - Flags: review?(ayang) → review+
Excellent, I had wondered if those existed.

Ideally, I would have liked to use a new taskqueue, but was can't create a taskqueue outside the main thread because there's an assert when it's trying to read a preference which is very silly
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: