Move up the definition of audio_write_get_buf_size(), so that it is
defined before it is used. Simplify.
... | ... |
@@ -218,7 +218,6 @@ typedef struct VideoState { |
218 | 218 |
} VideoState; |
219 | 219 |
|
220 | 220 |
static void show_help(void); |
221 |
-static int audio_write_get_buf_size(VideoState *is); |
|
222 | 221 |
|
223 | 222 |
/* options specified by the user */ |
224 | 223 |
static AVInputFormat *file_iformat; |
... | ... |
@@ -763,6 +762,13 @@ static void video_image_display(VideoState *is) |
763 | 763 |
} |
764 | 764 |
} |
765 | 765 |
|
766 |
+/* get the current audio output buffer size, in samples. With SDL, we |
|
767 |
+ cannot have a precise information */ |
|
768 |
+static int audio_write_get_buf_size(VideoState *is) |
|
769 |
+{ |
|
770 |
+ return is->audio_buf_size - is->audio_buf_index; |
|
771 |
+} |
|
772 |
+ |
|
766 | 773 |
static inline int compute_mod(int a, int b) |
767 | 774 |
{ |
768 | 775 |
return a < 0 ? a%b + b : a%b; |
... | ... |
@@ -2141,14 +2147,6 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr) |
2141 | 2141 |
} |
2142 | 2142 |
} |
2143 | 2143 |
|
2144 |
-/* get the current audio output buffer size, in samples. With SDL, we |
|
2145 |
- cannot have a precise information */ |
|
2146 |
-static int audio_write_get_buf_size(VideoState *is) |
|
2147 |
-{ |
|
2148 |
- return is->audio_buf_size - is->audio_buf_index; |
|
2149 |
-} |
|
2150 |
- |
|
2151 |
- |
|
2152 | 2144 |
/* prepare a new audio buffer */ |
2153 | 2145 |
static void sdl_audio_callback(void *opaque, Uint8 *stream, int len) |
2154 | 2146 |
{ |