Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advance Timestamp when empty payload is packetized #192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adamroach
Copy link

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
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.
@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

Merging #192 (853b8fc) into master (9a6e1d0) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #192      +/-   ##
==========================================
- Coverage   87.36%   87.31%   -0.05%     
==========================================
  Files          18       18              
  Lines        1773     1774       +1     
==========================================
  Hits         1549     1549              
- Misses        195      196       +1     
  Partials       29       29              
Flag Coverage Δ
go 87.31% <0.00%> (-0.05%) ⬇️
wasm 86.30% <0.00%> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
packetizer.go 77.35% <0.00%> (-1.49%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a6e1d0...853b8fc. Read the comment docs.

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.

None yet

1 participant