summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2008-04-14 22:31:49 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2008-04-14 22:31:49 +0000
commite5295c0dd9382070dc36ae464932d10bb8d032cf (patch)
tree4d07380f1c3378df42f9b2c8e0591d2595fbbefb /ffmpeg.c
parent16507ddd6b0eee407b6e2c37e91c8af4be0d2370 (diff)
Move av_exit() so it can be used by more functions
without needing forward declaration. Originally committed as revision 12826 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c106
1 files changed, 53 insertions, 53 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index affb9d201e..7a3d7073d4 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -371,6 +371,59 @@ static int decode_interrupt_cb(void)
return q_pressed || (q_pressed = read_key() == 'q');
}
+static int av_exit()
+{
+ int i;
+
+ /* close files */
+ for(i=0;i<nb_output_files;i++) {
+ /* maybe av_close_output_file ??? */
+ AVFormatContext *s = output_files[i];
+ int j;
+ if (!(s->oformat->flags & AVFMT_NOFILE))
+ url_fclose(s->pb);
+ for(j=0;j<s->nb_streams;j++) {
+ av_free(s->streams[j]->codec);
+ av_free(s->streams[j]);
+ }
+ av_free(s);
+ }
+ for(i=0;i<nb_input_files;i++)
+ av_close_input_file(input_files[i]);
+
+ av_free_static();
+
+ av_free(intra_matrix);
+ av_free(inter_matrix);
+
+ if (vstats_file)
+ fclose(vstats_file);
+ av_free(vstats_filename);
+
+ av_free(opt_names);
+
+ av_free(video_codec_name);
+ av_free(audio_codec_name);
+ av_free(subtitle_codec_name);
+
+ av_free(video_standard);
+
+#ifdef CONFIG_POWERPC_PERF
+ extern void powerpc_display_perf_report(void);
+ powerpc_display_perf_report();
+#endif /* CONFIG_POWERPC_PERF */
+
+ if (received_sigterm) {
+ fprintf(stderr,
+ "Received signal %d: terminating.\n",
+ (int) received_sigterm);
+ exit (255);
+ }
+
+ exit(0); /* not all OS-es handle main() return value */
+ return 0;
+}
+
static int read_ffserver_streams(AVFormatContext *s, const char *filename)
{
int i, err;
@@ -3841,59 +3894,6 @@ const OptionDef options[] = {
{ NULL, },
};
-static int av_exit()
-{
- int i;
-
- /* close files */
- for(i=0;i<nb_output_files;i++) {
- /* maybe av_close_output_file ??? */
- AVFormatContext *s = output_files[i];
- int j;
- if (!(s->oformat->flags & AVFMT_NOFILE))
- url_fclose(s->pb);
- for(j=0;j<s->nb_streams;j++) {
- av_free(s->streams[j]->codec);
- av_free(s->streams[j]);
- }
- av_free(s);
- }
- for(i=0;i<nb_input_files;i++)
- av_close_input_file(input_files[i]);
-
- av_free_static();
-
- av_free(intra_matrix);
- av_free(inter_matrix);
-
- if (vstats_file)
- fclose(vstats_file);
- av_free(vstats_filename);
-
- av_free(opt_names);
-
- av_free(video_codec_name);
- av_free(audio_codec_name);
- av_free(subtitle_codec_name);
-
- av_free(video_standard);
-
-#ifdef CONFIG_POWERPC_PERF
- extern void powerpc_display_perf_report(void);
- powerpc_display_perf_report();
-#endif /* CONFIG_POWERPC_PERF */
-
- if (received_sigterm) {
- fprintf(stderr,
- "Received signal %d: terminating.\n",
- (int) received_sigterm);
- exit (255);
- }
-
- exit(0); /* not all OS-es handle main() return value */
- return 0;
-}
-
int main(int argc, char **argv)
{
int i;