Closed Bug 1540251 Opened 1 year ago Closed 1 year ago

Workaround unset OpenH264 NAL size in WebrtcGmpVideoEncoder::Encoded


(Core :: WebRTC: Audio/Video, enhancement, P2)

67 Branch



Tracking Status
firefox67 --- fixed
firefox68 --- fixed


(Reporter: dminor, Assigned: dminor)


(Depends on 1 open bug)



(1 file)

In Bug 1533001, we're hitting an assertion due to an invalid size coming from OpenH264 on Android. It turns out the invalid size is always 0x01000000, which indicates that the codec did not set a size for that NAL.

This issue has been reported to Cisco. For now, we can just ignore the bad frames as a workaround. We can revert this change once the issue has been fixed upstream.

OpenH264 1.8.1 occasionally generates a size of 0x01000000. This is a magic
value in the NAL which should be replaced with a valid size, but for some
reason this is not always happening. If we return early here, encoding will
continue to work as expected. This workaround can be removed once this issue is
addressed upstream, although that may require a new release of OpenH264.

Pushed by
Workaround unset NAL size in WebrtcGmpVideoEncoder::Encoded; r=pehrsons
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68

Comment on attachment 9054605 [details]
Bug 1540251 - Workaround unset NAL size in WebrtcGmpVideoEncoder::Encoded; r=pehrsons!

Beta/Release Uplift Approval Request

  • User impact if declined: This doesn't have an user impact. This change returns early before an assertion and so only affects debug builds which are not normally run by users. I would like to uplift this so we match the behaviour on Nightly and to make it easier to debug if we hit problems with OpenH264 on Beta.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This doesn't change the existing behaviour on non-debug builds. On debug builds, it will return early prior to an assertion to workaround a known problem with the 1.8.1 OpenH264 plugin.
  • String changes made/needed: None
Attachment #9054605 - Flags: approval-mozilla-beta?

Comment on attachment 9054605 [details]
Bug 1540251 - Workaround unset NAL size in WebrtcGmpVideoEncoder::Encoded; r=pehrsons!

No impact on users build but will make our devs life easier, uplift approved for 67 beta 15, thanks.

Attachment #9054605 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.