Skip to content

Conversation

adamroach
Copy link
Member

Description

Currently, the Packetize method has a sanity check that the payload
being packetized is not of zero length; if is, then the function returns
without doing anything. This interacts poorly with pion's binding to
OpenH264, which simply returns payloads of zero length when encode()
is called but a frame must be skipped for bandwidth limitation reasons.

The most straightforward use of these two APIs with each other leads to
a situation where an application reads an empty payload from OpenH264
and writes it into the Payloader directly. When this happens, the count
of samples is not advanced, leading to incorrect timestamps in the
generated RTP packets (which can cause A/V sync issues). This change
simply ensures that the Packetizer Timestamp gets updated under such
circumstances.

@adamroach adamroach requested a review from Sean-Der June 24, 2022 20:23
@pionbot pionbot force-pushed the packetizer-zero-length-fix branch from 81d731a to 853b8fc Compare June 24, 2022 20:24
@codecov
Copy link

codecov bot commented Jun 24, 2022

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.09%. Comparing base (f4f616d) to head (7dfffce).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #192   +/-   ##
=======================================
  Coverage   91.09%   91.09%           
=======================================
  Files          26       26           
  Lines        3188     3190    +2     
=======================================
+ Hits         2904     2906    +2     
  Misses        221      221           
  Partials       63       63           
Flag Coverage Δ
go 91.09% <100.00%> (+<0.01%) ⬆️
wasm ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Sean-Der Sean-Der force-pushed the packetizer-zero-length-fix branch from 853b8fc to 2dbb57b Compare October 17, 2025 20:07
Curently, the `Packetize` method has a sanity check that the payload
being packetized is not of zero length; if is, then the function returns
without doing anything. This interacts poorly with pion's binding to
OpenH264, which simply returns payloads of zero length when `encode()`
is called but a frame must be skipped for bandwidth limitation reasons.

The most straightforward use of these two APIs with each other leads to
a situation where an application reads an empty payload from OpenH264
and writes it into the Payloader directly. When this happens, the count
of samples is not advanced, leading to incorrect timestamps in the
generated RTP packets (which can cause A/V sync issues).  This change
simply ensures that the Packetizer Timestamp gets updated under such
circumstances.
@Sean-Der Sean-Der force-pushed the packetizer-zero-length-fix branch from 2dbb57b to 7dfffce Compare October 17, 2025 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant