MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_samples_to_time_base

Function ff_samples_to_time_base

libavcodec/encode.h:93–100  ·  view source on GitHub ↗

* Rescale from sample rate to AVCodecContext.time_base. */

Source from the content-addressed store, hash-verified

91 * Rescale from sample rate to AVCodecContext.time_base.
92 */
93static av_always_inline int64_t ff_samples_to_time_base(const AVCodecContext *avctx,
94 int64_t samples)
95{
96 if (samples == AV_NOPTS_VALUE)
97 return AV_NOPTS_VALUE;
98 return av_rescale_q(samples, (AVRational){ 1, avctx->sample_rate },
99 avctx->time_base);
100}
101
102/**
103 * Rescale from time base to AVCodecContext.sample_rate.

Callers 10

libvorbis_encode_frameFunction · 0.85
ff_ac3_encode_frameFunction · 0.85
mpa_encode_frameFunction · 0.85
g722_encode_frameFunction · 0.85
encode_superframeFunction · 0.85
ff_encode_encode_cbFunction · 0.85
flac_encode_frameFunction · 0.85
amr_wb_encode_frameFunction · 0.85
twolame_encode_frameFunction · 0.85
ff_af_queue_removeFunction · 0.85

Calls 1

av_rescale_qFunction · 0.85

Tested by

no test coverage detected