int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,

                     AVFormatContext *src)

{

    AVPacket local_pkt;



    local_pkt = *pkt;

    local_pkt.stream_index = dst_stream;

    if (pkt->pts != AV_NOPTS_VALUE)

        local_pkt.pts = av_rescale_q(pkt->pts,

                                     src->streams[pkt->stream_index]->time_base,

                                     dst->streams[dst_stream]->time_base);

    if (pkt->dts != AV_NOPTS_VALUE)

        local_pkt.dts = av_rescale_q(pkt->dts,

                                     src->streams[pkt->stream_index]->time_base,

                                     dst->streams[dst_stream]->time_base);

    if (pkt->duration)

        local_pkt.duration = av_rescale_q(pkt->duration,

                                          src->streams[pkt->stream_index]->time_base,

                                          dst->streams[dst_stream]->time_base);

    return av_write_frame(dst, &local_pkt);

}

int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,

                     AVFormatContext *src)

{

    AVPacket local_pkt;



    local_pkt = *pkt;

    local_pkt.stream_index = dst_stream;

    if (pkt->pts != AV_NOPTS_VALUE)

        local_pkt.pts = av_rescale_q(pkt->pts,

                                     src->streams[pkt->stream_index]->time_base,

                                     dst->streams[dst_stream]->time_base);

    if (pkt->dts != AV_NOPTS_VALUE)

        local_pkt.dts = av_rescale_q(pkt->dts,

                                     src->streams[pkt->stream_index]->time_base,

                                     dst->streams[dst_stream]->time_base);

    if (pkt->duration)

        local_pkt.duration = av_rescale_q(pkt->duration,

                                          src->streams[pkt->stream_index]->time_base,

                                          dst->streams[dst_stream]->time_base);

    return av_write_frame(dst, &local_pkt);

}

    return av_write_frame(dst, &local_pkt);
int FUNC_0(AVFormatContext *VAR_0, int VAR_1, AVPacket *VAR_2,

                     AVFormatContext *VAR_3)

{

    AVPacket local_pkt;



    local_pkt = *VAR_2;

    local_pkt.stream_index = VAR_1;

    if (VAR_2->pts != AV_NOPTS_VALUE)

        local_pkt.pts = av_rescale_q(VAR_2->pts,

                                     VAR_3->streams[VAR_2->stream_index]->time_base,

                                     VAR_0->streams[VAR_1]->time_base);

    if (VAR_2->dts != AV_NOPTS_VALUE)

        local_pkt.dts = av_rescale_q(VAR_2->dts,

                                     VAR_3->streams[VAR_2->stream_index]->time_base,

                                     VAR_0->streams[VAR_1]->time_base);

    if (VAR_2->duration)

        local_pkt.duration = av_rescale_q(VAR_2->duration,

                                          VAR_3->streams[VAR_2->stream_index]->time_base,

                                          VAR_0->streams[VAR_1]->time_base);

    return av_write_frame(VAR_0, &local_pkt);

}

int FUNC_0(AVFormatContext *VAR_0, int VAR_1, AVPacket *VAR_2,
AVFormatContext *VAR_3)
{ AVPacket local_pkt; local_pkt = *VAR_2; local_pkt.stream_index = VAR_1; if (VAR_2->pts != AV_NOPTS_VALUE)
local_pkt.pts = av_rescale_q(VAR_2->pts,
VAR_3->streams[VAR_2->stream_index]->time_base,
VAR_0->streams[VAR_1]->time_base); if (VAR_2->dts != AV_NOPTS_VALUE)
local_pkt.dts = av_rescale_q(VAR_2->dts,
VAR_3->streams[VAR_2->stream_index]->time_base,
VAR_0->streams[VAR_1]->time_base); if (VAR_2->duration)
local_pkt.duration = av_rescale_q(VAR_2->duration,
VAR_3->streams[VAR_2->stream_index]->time_base,
VAR_0->streams[VAR_1]->time_base); return av_write_frame(VAR_0, &local_pkt); }