static int copy_stream_props(AVStream *st, AVStream *source_st)

{

    int ret;



    if (st->codecpar->codec_id || !source_st->codecpar->codec_id) {

        if (st->codecpar->extradata_size < source_st->codecpar->extradata_size) {

            if (st->codecpar->extradata) {

                av_freep(&st->codecpar->extradata);

                st->codecpar->extradata_size = 0;

            }

            ret = ff_alloc_extradata(st->codecpar,

                                     source_st->codecpar->extradata_size);

            if (ret < 0)

                return ret;

        }

        memcpy(st->codecpar->extradata, source_st->codecpar->extradata,

               source_st->codecpar->extradata_size);

        return 0;

    }

    if ((ret = avcodec_parameters_copy(st->codecpar, source_st->codecpar)) < 0)

        return ret;

    st->r_frame_rate        = source_st->r_frame_rate;

    st->avg_frame_rate      = source_st->avg_frame_rate;

    st->time_base           = source_st->time_base;

    st->sample_aspect_ratio = source_st->sample_aspect_ratio;



    av_dict_copy(&st->metadata, source_st->metadata, 0);

    return 0;

}

static int copy_stream_props(AVStream *st, AVStream *source_st)

{

    int ret;



    if (st->codecpar->codec_id || !source_st->codecpar->codec_id) {

        if (st->codecpar->extradata_size < source_st->codecpar->extradata_size) {

            if (st->codecpar->extradata) {

                av_freep(&st->codecpar->extradata);

                st->codecpar->extradata_size = 0;

            }

            ret = ff_alloc_extradata(st->codecpar,

                                     source_st->codecpar->extradata_size);

            if (ret < 0)

                return ret;

        }

        memcpy(st->codecpar->extradata, source_st->codecpar->extradata,

               source_st->codecpar->extradata_size);

        return 0;

    }

    if ((ret = avcodec_parameters_copy(st->codecpar, source_st->codecpar)) < 0)

        return ret;

    st->r_frame_rate        = source_st->r_frame_rate;

    st->avg_frame_rate      = source_st->avg_frame_rate;

    st->time_base           = source_st->time_base;

    st->sample_aspect_ratio = source_st->sample_aspect_ratio;



    av_dict_copy(&st->metadata, source_st->metadata, 0);

    return 0;

}

static int FUNC_0(AVStream *VAR_0, AVStream *VAR_1)

{

    int VAR_2;



    if (VAR_0->codecpar->codec_id || !VAR_1->codecpar->codec_id) {

        if (VAR_0->codecpar->extradata_size < VAR_1->codecpar->extradata_size) {

            if (VAR_0->codecpar->extradata) {

                av_freep(&VAR_0->codecpar->extradata);

                VAR_0->codecpar->extradata_size = 0;

            }

            VAR_2 = ff_alloc_extradata(VAR_0->codecpar,

                                     VAR_1->codecpar->extradata_size);

            if (VAR_2 < 0)

                return VAR_2;

        }

        memcpy(VAR_0->codecpar->extradata, VAR_1->codecpar->extradata,

               VAR_1->codecpar->extradata_size);

        return 0;

    }

    if ((VAR_2 = avcodec_parameters_copy(VAR_0->codecpar, VAR_1->codecpar)) < 0)

        return VAR_2;

    VAR_0->r_frame_rate        = VAR_1->r_frame_rate;

    VAR_0->avg_frame_rate      = VAR_1->avg_frame_rate;

    VAR_0->time_base           = VAR_1->time_base;

    VAR_0->sample_aspect_ratio = VAR_1->sample_aspect_ratio;



    av_dict_copy(&VAR_0->metadata, VAR_1->metadata, 0);

    return 0;

}

static int FUNC_0(AVStream *VAR_0, AVStream *VAR_1)
{ int VAR_2; if (VAR_0->codecpar->codec_id || !VAR_1->codecpar->codec_id) { if (VAR_0->codecpar->extradata_size < VAR_1->codecpar->extradata_size) { if (VAR_0->codecpar->extradata) { av_freep(&VAR_0->codecpar->extradata); VAR_0->codecpar->extradata_size = 0; } VAR_2 = ff_alloc_extradata(VAR_0->codecpar,
VAR_1->codecpar->extradata_size); if (VAR_2 < 0)
return VAR_2; } memcpy(VAR_0->codecpar->extradata, VAR_1->codecpar->extradata,
VAR_1->codecpar->extradata_size); return 0; } if ((VAR_2 = avcodec_parameters_copy(VAR_0->codecpar, VAR_1->codecpar)) < 0)
return VAR_2; VAR_0->r_frame_rate        = VAR_1->r_frame_rate; VAR_0->avg_frame_rate      = VAR_1->avg_frame_rate; VAR_0->time_base           = VAR_1->time_base; VAR_0->sample_aspect_ratio = VAR_1->sample_aspect_ratio; av_dict_copy(&VAR_0->metadata, VAR_1->metadata, 0); return 0; }