[FFmpeg-cvslog] swresample_internal.h: Move struct declaration before first use.

Reimar Döffinger git at videolan.org
Tue Jan 27 22:31:22 CET 2015


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Sun Jan 18 23:29:13 2015 +0100| [6efd0ba977aee08a2cec10dca1584a8959e19fc7] | committer: Reimar Döffinger

swresample_internal.h: Move struct declaration before first use.

It seems more logical and works with more restricted C compilers
like tinycc.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6efd0ba977aee08a2cec10dca1584a8959e19fc7
---

 libswresample/swresample_internal.h |   42 +++++++++++++++++------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/libswresample/swresample_internal.h b/libswresample/swresample_internal.h
index 3761843..6250921 100644
--- a/libswresample/swresample_internal.h
+++ b/libswresample/swresample_internal.h
@@ -68,6 +68,27 @@ struct DitherContext {
     int output_sample_bits;                         ///< the number of used output bits, needed to scale dither correctly
 };
 
+typedef struct ResampleContext * (* resample_init_func)(struct ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear,
+                                    double cutoff, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta, double precision, int cheby);
+typedef void    (* resample_free_func)(struct ResampleContext **c);
+typedef int     (* multiple_resample_func)(struct ResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed);
+typedef int     (* resample_flush_func)(struct SwrContext *c);
+typedef int     (* set_compensation_func)(struct ResampleContext *c, int sample_delta, int compensation_distance);
+typedef int64_t (* get_delay_func)(struct SwrContext *s, int64_t base);
+typedef int     (* invert_initial_buffer_func)(struct ResampleContext *c, AudioData *dst, const AudioData *src, int src_size, int *dst_idx, int *dst_count);
+
+struct Resampler {
+  resample_init_func            init;
+  resample_free_func            free;
+  multiple_resample_func        multiple_resample;
+  resample_flush_func           flush;
+  set_compensation_func         set_compensation;
+  get_delay_func                get_delay;
+  invert_initial_buffer_func    invert_initial_buffer;
+};
+
+extern struct Resampler const swri_resampler;
+
 struct SwrContext {
     const AVClass *av_class;                        ///< AVClass used for AVOption and av_log()
     int log_level_offset;                           ///< logging level offset
@@ -152,27 +173,6 @@ struct SwrContext {
     /* TODO: callbacks for ASM optimizations */
 };
 
-typedef struct ResampleContext * (* resample_init_func)(struct ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear,
-                                    double cutoff, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta, double precision, int cheby);
-typedef void    (* resample_free_func)(struct ResampleContext **c);
-typedef int     (* multiple_resample_func)(struct ResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed);
-typedef int     (* resample_flush_func)(struct SwrContext *c);
-typedef int     (* set_compensation_func)(struct ResampleContext *c, int sample_delta, int compensation_distance);
-typedef int64_t (* get_delay_func)(struct SwrContext *s, int64_t base);
-typedef int     (* invert_initial_buffer_func)(struct ResampleContext *c, AudioData *dst, const AudioData *src, int src_size, int *dst_idx, int *dst_count);
-
-struct Resampler {
-  resample_init_func            init;
-  resample_free_func            free;
-  multiple_resample_func        multiple_resample;
-  resample_flush_func           flush;
-  set_compensation_func         set_compensation;
-  get_delay_func                get_delay;
-  invert_initial_buffer_func    invert_initial_buffer;
-};
-
-extern struct Resampler const swri_resampler;
-
 int swri_realloc_audio(AudioData *a, int count);
 
 void swri_noise_shaping_int16 (SwrContext *s, AudioData *dsts, const AudioData *srcs, const AudioData *noises, int count);



More information about the ffmpeg-cvslog mailing list