Revision e5295c0d ffmpeg.c

View differences:

ffmpeg.c
371 371
    return q_pressed || (q_pressed = read_key() == 'q');
372 372
}
373 373

  
374
static int av_exit()
375
{
376
    int i;
377

  
378
    /* close files */
379
    for(i=0;i<nb_output_files;i++) {
380
        /* maybe av_close_output_file ??? */
381
        AVFormatContext *s = output_files[i];
382
        int j;
383
        if (!(s->oformat->flags & AVFMT_NOFILE))
384
            url_fclose(s->pb);
385
        for(j=0;j<s->nb_streams;j++) {
386
            av_free(s->streams[j]->codec);
387
            av_free(s->streams[j]);
388
        }
389
        av_free(s);
390
    }
391
    for(i=0;i<nb_input_files;i++)
392
        av_close_input_file(input_files[i]);
393

  
394
    av_free_static();
395

  
396
    av_free(intra_matrix);
397
    av_free(inter_matrix);
398

  
399
    if (vstats_file)
400
        fclose(vstats_file);
401
    av_free(vstats_filename);
402

  
403
    av_free(opt_names);
404

  
405
    av_free(video_codec_name);
406
    av_free(audio_codec_name);
407
    av_free(subtitle_codec_name);
408

  
409
    av_free(video_standard);
410

  
411
#ifdef CONFIG_POWERPC_PERF
412
    extern void powerpc_display_perf_report(void);
413
    powerpc_display_perf_report();
414
#endif /* CONFIG_POWERPC_PERF */
415

  
416
    if (received_sigterm) {
417
        fprintf(stderr,
418
            "Received signal %d: terminating.\n",
419
            (int) received_sigterm);
420
        exit (255);
421
    }
422

  
423
    exit(0); /* not all OS-es handle main() return value */
424
    return 0;
425
}
426

  
374 427
static int read_ffserver_streams(AVFormatContext *s, const char *filename)
375 428
{
376 429
    int i, err;
......
3841 3894
    { NULL, },
3842 3895
};
3843 3896

  
3844
static int av_exit()
3845
{
3846
    int i;
3847

  
3848
    /* close files */
3849
    for(i=0;i<nb_output_files;i++) {
3850
        /* maybe av_close_output_file ??? */
3851
        AVFormatContext *s = output_files[i];
3852
        int j;
3853
        if (!(s->oformat->flags & AVFMT_NOFILE))
3854
            url_fclose(s->pb);
3855
        for(j=0;j<s->nb_streams;j++) {
3856
            av_free(s->streams[j]->codec);
3857
            av_free(s->streams[j]);
3858
        }
3859
        av_free(s);
3860
    }
3861
    for(i=0;i<nb_input_files;i++)
3862
        av_close_input_file(input_files[i]);
3863

  
3864
    av_free_static();
3865

  
3866
    av_free(intra_matrix);
3867
    av_free(inter_matrix);
3868

  
3869
    if (vstats_file)
3870
        fclose(vstats_file);
3871
    av_free(vstats_filename);
3872

  
3873
    av_free(opt_names);
3874

  
3875
    av_free(video_codec_name);
3876
    av_free(audio_codec_name);
3877
    av_free(subtitle_codec_name);
3878

  
3879
    av_free(video_standard);
3880

  
3881
#ifdef CONFIG_POWERPC_PERF
3882
    extern void powerpc_display_perf_report(void);
3883
    powerpc_display_perf_report();
3884
#endif /* CONFIG_POWERPC_PERF */
3885

  
3886
    if (received_sigterm) {
3887
        fprintf(stderr,
3888
            "Received signal %d: terminating.\n",
3889
            (int) received_sigterm);
3890
        exit (255);
3891
    }
3892

  
3893
    exit(0); /* not all OS-es handle main() return value */
3894
    return 0;
3895
}
3896

  
3897 3897
int main(int argc, char **argv)
3898 3898
{
3899 3899
    int i;

Also available in: Unified diff