static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
{
    ConcatContext *cat = avf->priv_data;
    int ret;
    int64_t delta;
    while (1) {
        if ((ret = av_read_frame(cat->avf, pkt)) != AVERROR_EOF ||
            (ret = open_next_file(avf)) < 0)
            break;
    }
    delta = av_rescale_q(cat->cur_file->start_time - cat->avf->start_time,
                         AV_TIME_BASE_Q,
                         cat->avf->streams[pkt->stream_index]->time_base);
    if (pkt->pts != AV_NOPTS_VALUE)
        pkt->pts += delta;
    if (pkt->dts != AV_NOPTS_VALUE)
        pkt->dts += delta;
}
static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
{
    ConcatContext *cat = avf->priv_data;
    int ret;
    int64_t delta;
    while (1) {
        if ((ret = av_read_frame(cat->avf, pkt)) != AVERROR_EOF ||
            (ret = open_next_file(avf)) < 0)
            break;
    }
    delta = av_rescale_q(cat->cur_file->start_time - cat->avf->start_time,
                         AV_TIME_BASE_Q,
                         cat->avf->streams[pkt->stream_index]->time_base);
    if (pkt->pts != AV_NOPTS_VALUE)
        pkt->pts += delta;
    if (pkt->dts != AV_NOPTS_VALUE)
        pkt->dts += delta;
}
static int FUNC_0(AVFormatContext *VAR_0, AVPacket *VAR_1)
{
    ConcatContext *cat = VAR_0->priv_data;
    int VAR_2;
    int64_t delta;
    while (1) {
        if ((VAR_2 = av_read_frame(cat->VAR_0, VAR_1)) != AVERROR_EOF ||
            (VAR_2 = open_next_file(VAR_0)) < 0)
            break;
    }
    delta = av_rescale_q(cat->cur_file->start_time - cat->VAR_0->start_time,
                         AV_TIME_BASE_Q,
                         cat->VAR_0->streams[VAR_1->stream_index]->time_base);
    if (VAR_1->pts != AV_NOPTS_VALUE)
        VAR_1->pts += delta;
    if (VAR_1->dts != AV_NOPTS_VALUE)
        VAR_1->dts += delta;
}
static int FUNC_0(AVFormatContext *VAR_0, AVPacket *VAR_1)
{ ConcatContext *cat = VAR_0->priv_data; int VAR_2; int64_t delta; while (1) { if ((VAR_2 = av_read_frame(cat->VAR_0, VAR_1)) != AVERROR_EOF ||
(VAR_2 = open_next_file(VAR_0)) < 0)
break; } delta = av_rescale_q(cat->cur_file->start_time - cat->VAR_0->start_time,
AV_TIME_BASE_Q,
cat->VAR_0->streams[VAR_1->stream_index]->time_base); if (VAR_1->pts != AV_NOPTS_VALUE)
VAR_1->pts += delta; if (VAR_1->dts != AV_NOPTS_VALUE)
VAR_1->dts += delta; }