Revision b22dbb29

View differences:

ffmpeg.c
505 505

  
506 506
    /* close files */
507 507
    for(i=0;i<nb_output_files;i++) {
508
        /* maybe av_close_output_file ??? */
509 508
        AVFormatContext *s = output_files[i];
510 509
        int j;
511 510
        if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
512 511
            url_fclose(s->pb);
513
        for(j=0;j<s->nb_streams;j++) {
514
            av_metadata_free(&s->streams[j]->metadata);
515
            av_free(s->streams[j]->codec);
516
            av_free(s->streams[j]->info);
517
            av_free(s->streams[j]);
518
        }
519
        for(j=0;j<s->nb_programs;j++) {
520
            av_metadata_free(&s->programs[j]->metadata);
521
        }
522
        for(j=0;j<s->nb_chapters;j++) {
523
            av_metadata_free(&s->chapters[j]->metadata);
524
        }
525
        av_metadata_free(&s->metadata);
526
        av_free(s);
512
        avformat_free_context(s);
527 513
        av_free(output_streams_for_file[i]);
528 514
    }
529 515
    for(i=0;i<nb_input_files;i++) {
libavformat/movenchint.c
81 81
        url_close_dyn_buf(track->rtp_ctx->pb, &buf);
82 82
        av_free(buf);
83 83
    }
84
    if (track->rtp_ctx && track->rtp_ctx->streams[0]) {
85
        av_metadata_free(&track->rtp_ctx->streams[0]->metadata);
86
        av_free(track->rtp_ctx->streams[0]->codec->extradata);
87
        av_free(track->rtp_ctx->streams[0]->codec);
88
        av_free(track->rtp_ctx->streams[0]->info);
89
        av_free(track->rtp_ctx->streams[0]);
90
    }
91 84
    if (track->rtp_ctx) {
92
        av_metadata_free(&track->rtp_ctx->metadata);
93
        av_free(track->rtp_ctx->priv_data);
94
        av_freep(&track->rtp_ctx);
85
        avformat_free_context(track->rtp_ctx);
86
        track->rtp_ctx = NULL;
95 87
    }
96 88
    av_freep(&track->enc);
97 89
    /* Set a default timescale, to avoid crashes in dump_format */
......
488 480
        url_close_dyn_buf(rtp_ctx->pb, &ptr);
489 481
        av_free(ptr);
490 482
    }
491
    av_metadata_free(&rtp_ctx->streams[0]->metadata);
492
    av_metadata_free(&rtp_ctx->metadata);
493
    av_free(rtp_ctx->streams[0]->codec->extradata);
494
    av_free(rtp_ctx->streams[0]->codec);
495
    av_free(rtp_ctx->streams[0]->info);
496
    av_free(rtp_ctx->streams[0]);
497
    av_freep(&rtp_ctx);
483
    avformat_free_context(rtp_ctx);
498 484
}
499 485

  
libavformat/rtpenc_chain.c
66 66
            url_close_dyn_buf(rtpctx->pb, &ptr);
67 67
            av_free(ptr);
68 68
        }
69
        av_free(rtpctx->streams[0]->codec->extradata);
70
        av_free(rtpctx->streams[0]->codec);
71
        av_free(rtpctx->streams[0]->info);
72
        av_free(rtpctx->streams[0]);
73
        av_free(rtpctx);
69
        avformat_free_context(rtpctx);
74 70
        return NULL;
75 71
    }
76 72

  
libavformat/rtsp.c
498 498
                } else {
499 499
                    url_fclose(rtpctx->pb);
500 500
                }
501
                av_metadata_free(&rtpctx->streams[0]->metadata);
502
                av_metadata_free(&rtpctx->metadata);
503
                av_free(rtpctx->streams[0]->codec->extradata);
504
                av_free(rtpctx->streams[0]->codec);
505
                av_free(rtpctx->streams[0]->info);
506
                av_free(rtpctx->streams[0]);
507
                av_free(rtpctx);
501
                avformat_free_context(rtpctx);
508 502
            } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
509 503
                ff_rdt_parse_close(rtsp_st->transport_priv);
510 504
            else if (CONFIG_RTPDEC)
libavformat/sapenc.c
46 46
            continue;
47 47
        av_write_trailer(rtpctx);
48 48
        url_fclose(rtpctx->pb);
49
        av_metadata_free(&rtpctx->streams[0]->metadata);
50
        av_metadata_free(&rtpctx->metadata);
51
        av_free(rtpctx->streams[0]->codec->extradata);
52
        av_free(rtpctx->streams[0]->codec);
53
        av_free(rtpctx->streams[0]->info);
54
        av_free(rtpctx->streams[0]);
55
        av_free(rtpctx);
49
        avformat_free_context(rtpctx);
56 50
        s->streams[i]->priv_data = NULL;
57 51
    }
58 52

  

Also available in: Unified diff