Revision 1338dc08 libavformat/movenchint.c

View differences:

libavformat/movenchint.c
57 57
    track->rtp_ctx->streams[0]->sample_aspect_ratio =
58 58
                        src_st->sample_aspect_ratio;
59 59

  
60
    /* Remove the allocated codec context, link to the original one
61
     * instead, to give the rtp muxer access to codec parameters. */
62
    av_free(track->rtp_ctx->streams[0]->codec);
63
    track->rtp_ctx->streams[0]->codec = src_st->codec;
60
    avcodec_copy_context(track->rtp_ctx->streams[0]->codec, src_st->codec);
64 61

  
65 62
    if ((ret = url_open_dyn_packet_buf(&track->rtp_ctx->pb,
66 63
                                       RTP_MAX_PACKET_SIZE)) < 0)
......
86 83
    }
87 84
    if (track->rtp_ctx && track->rtp_ctx->streams[0]) {
88 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);
89 88
        av_free(track->rtp_ctx->streams[0]->info);
90 89
        av_free(track->rtp_ctx->streams[0]);
91 90
    }
......
491 490
    }
492 491
    av_metadata_free(&rtp_ctx->streams[0]->metadata);
493 492
    av_metadata_free(&rtp_ctx->metadata);
493
    av_free(rtp_ctx->streams[0]->codec->extradata);
494
    av_free(rtp_ctx->streams[0]->codec);
494 495
    av_free(rtp_ctx->streams[0]->info);
495 496
    av_free(rtp_ctx->streams[0]);
496 497
    av_freep(&rtp_ctx);

Also available in: Unified diff