MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / removeAudioJitter

Function removeAudioJitter

libhb/sync.c:976–998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

974}
975
976static void removeAudioJitter(sync_stream_t * stream, int stop)
977{
978 int ii;
979 hb_buffer_t * buf;
980 double next_pts;
981
982 // If duration of sum of packet durations is close to duration
983 // as measured by timestamps, align timestamps to packet durations.
984 // The packet durations are computed based on samplerate and
985 // number of samples and are therefore a reliable measure
986 // of the actual duration of an audio frame.
987 buf = hb_list_item(stream->in_queue, 0);
988 buf->s.start = stream->next_pts;
989 next_pts = stream->next_pts + buf->s.duration;
990 for (ii = 1; ii <= stop; ii++)
991 {
992 // Duration can be fractional, so track fractional PTS
993 buf->s.stop = next_pts;
994 buf = hb_list_item(stream->in_queue, ii);
995 buf->s.start = next_pts;
996 next_pts += buf->s.duration;
997 }
998}
999
1000// Look for a sequence of packets whose duration as measure by packet
1001// durations closely matches the duration as measured by timestamp

Callers 1

dejitterAudioFunction · 0.85

Calls 1

hb_list_itemFunction · 0.85

Tested by

no test coverage detected