-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use a new silent frame insert algorithm for audio remux (#354)
* use a new silent frame insert algorithm for audio remux. the old algorithm cannot cover some common situation, like: 1. audio frame dts does not increase by a standard duration, sometimes it increase for a large duration(more than 1.5 * refSampleDuration), sometimes it increase for a small duration. But the average duration is more or less to refSampleDuration. the old algorithm would insert silent frames which result into video/audio unsync. 2. for network living stream, because of network jitter or frame lost, the encoder would generate the audio frames whose dts is not correct. but if the gap between two adjacent frame is not over 1.5 * refSampleDuration and the accumulate gap would become larger and larger. the old algorithm never insert silent frames for this case. * initialize _audioNextRefDts when seeking * fix: lint error * test * fix a curRefDts update mistake * reuse some original variable which has the same meaning * fix some variable mistake * bug fix: incorrect byte length Co-authored-by: xiaosong <kunkkaco@gmail.com> Co-authored-by: wangjiankai <wangjiankai@cmhi.chinamobile.com>
- Loading branch information
1 parent
4485c09
commit 26d00d9
Showing
2 changed files
with
122 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters