static void read_packets(WriterContext *w, AVFormatContext *fmt_ctx)

{

    int i, ret = 0;

    int64_t cur_ts = fmt_ctx->start_time;



    if (read_intervals_nb == 0) {

        ReadInterval interval = (ReadInterval) { .has_start = 0, .has_end = 0 };

        ret = read_interval_packets(w, fmt_ctx, &interval, &cur_ts);

    } else {

        for (i = 0; i < read_intervals_nb; i++) {

            ret = read_interval_packets(w, fmt_ctx, &read_intervals[i], &cur_ts);

            if (ret < 0)

                break;

        }

    }

}

static void read_packets(WriterContext *w, AVFormatContext *fmt_ctx)

{

    int i, ret = 0;

    int64_t cur_ts = fmt_ctx->start_time;



    if (read_intervals_nb == 0) {

        ReadInterval interval = (ReadInterval) { .has_start = 0, .has_end = 0 };

        ret = read_interval_packets(w, fmt_ctx, &interval, &cur_ts);

    } else {

        for (i = 0; i < read_intervals_nb; i++) {

            ret = read_interval_packets(w, fmt_ctx, &read_intervals[i], &cur_ts);

            if (ret < 0)

                break;

        }

    }

}

static void FUNC_0(WriterContext *VAR_0, AVFormatContext *VAR_1)

{

    int VAR_2, VAR_3 = 0;

    int64_t cur_ts = VAR_1->start_time;



    if (read_intervals_nb == 0) {

        ReadInterval interval = (ReadInterval) { .has_start = 0, .has_end = 0 };

        VAR_3 = read_interval_packets(VAR_0, VAR_1, &interval, &cur_ts);

    } else {

        for (VAR_2 = 0; VAR_2 < read_intervals_nb; VAR_2++) {

            VAR_3 = read_interval_packets(VAR_0, VAR_1, &read_intervals[VAR_2], &cur_ts);

            if (VAR_3 < 0)

                break;

        }

    }

}

static void FUNC_0(WriterContext *VAR_0, AVFormatContext *VAR_1)
{ int VAR_2, VAR_3 = 0; int64_t cur_ts = VAR_1->start_time; if (read_intervals_nb == 0) { ReadInterval interval = (ReadInterval) { .has_start = 0, .has_end = 0 }; VAR_3 = read_interval_packets(VAR_0, VAR_1, &interval, &cur_ts); } else { for (VAR_2 = 0; VAR_2 < read_intervals_nb; VAR_2++) { VAR_3 = read_interval_packets(VAR_0, VAR_1, &read_intervals[VAR_2], &cur_ts); if (VAR_3 < 0)
break; } } }