]> git.sesse.net Git - ffmpeg/blobdiff - libswresample/swresample.h
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libswresample / swresample.h
index 071db42a71e65d5cdc1e8fea8d91829324f56426..6dd8a47d20058753aeed93e0946cff89384f3af9 100644 (file)
@@ -47,8 +47,8 @@
  * av_opt_set_int(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO,  0);
  * av_opt_set_int(swr, "in_sample_rate",     48000,                0);
  * av_opt_set_int(swr, "out_sample_rate",    44100,                0);
- * av_opt_set_int(swr, "in_sample_fmt",      AV_SAMPLE_FMT_FLTP,   0);
- * av_opt_set_int(swr, "out_sample_fmt,      AV_SAMPLE_FMT_S16,    0);
+ * av_opt_set_sample_fmt(swr, "in_sample_fmt", AV_SAMPLE_FMT_FLTP, 0);
+ * av_opt_set_sample_fmt(swr, "out_sample_fmt, AV_SAMPLE_FMT_S16,  0);
  * @endcode
  *
  * Once all values have been set, it must be initialized with swr_init(). If
@@ -74,7 +74,7 @@
  * int in_samples;
  *
  * while (get_input(&input, &in_samples)) {
- *     uint8_t *output
+ *     uint8_t *output;
  *     int out_samples = av_rescale_rnd(swr_get_delay(swr, 48000) +
  *                                      in_samples, 44100, 48000, AV_ROUND_UP);
  *     av_samples_alloc(&output, NULL, 2, out_samples,
@@ -92,7 +92,7 @@
  * swr_free().
  */
 
-#include <inttypes.h>
+#include <stdint.h>
 #include "libavutil/samplefmt.h"
 
 #include "libswresample/version.h"
@@ -201,7 +201,7 @@ int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
 
 /**
  * Convert the next timestamp from input to output
- * timestampe are in 1/(in_sample_rate * out_sample_rate) units.
+ * timestamps are in 1/(in_sample_rate * out_sample_rate) units.
  *
  * @note There are 2 slightly differently behaving modes.
  *       First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX)
@@ -209,8 +209,8 @@ int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
  *       Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX)
  *              in this case the output timestamps will match output sample numbers
  *
- * @param pts   timstamp for the next input sample, INT64_MIN if unknown
- * @returns the output timestamp for the next output sample
+ * @param pts   timestamp for the next input sample, INT64_MIN if unknown
+ * @return the output timestamp for the next output sample
  */
 int64_t swr_next_pts(struct SwrContext *s, int64_t pts);
 
@@ -256,6 +256,10 @@ int swr_inject_silence(struct SwrContext *s, int count);
  * Swresample can buffer data if more input has been provided than available
  * output space, also converting between sample rates needs a delay.
  * This function returns the sum of all such delays.
+ * The exact delay is not necessarily an integer value in either input or
+ * output sample rate. Especially when downsampling by a large value, the
+ * output sample rate may be a poor choice to represent the delay, similarly
+ * for upsampling and the input sample rate.
  *
  * @param s     swr context
  * @param base  timebase in which the returned delay will be