static int seg_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt)

{

    SegmentContext *seg = s->priv_data;

    AVFormatContext *oc = seg->avf;

    if (oc->oformat->check_bitstream) {

        int ret = oc->oformat->check_bitstream(oc, pkt);

        if (ret == 1) {

            AVStream *st = s->streams[pkt->stream_index];

            AVStream *ost = oc->streams[pkt->stream_index];

            st->internal->bsfcs = ost->internal->bsfcs;

            st->internal->nb_bsfcs = ost->internal->nb_bsfcs;

            ost->internal->bsfcs = NULL;

            ost->internal->nb_bsfcs = 0;

        }

        return ret;

    }

    return 1;

}

static int seg_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt)

{

    SegmentContext *seg = s->priv_data;

    AVFormatContext *oc = seg->avf;

    if (oc->oformat->check_bitstream) {

        int ret = oc->oformat->check_bitstream(oc, pkt);

        if (ret == 1) {

            AVStream *st = s->streams[pkt->stream_index];

            AVStream *ost = oc->streams[pkt->stream_index];

            st->internal->bsfcs = ost->internal->bsfcs;

            st->internal->nb_bsfcs = ost->internal->nb_bsfcs;

            ost->internal->bsfcs = NULL;

            ost->internal->nb_bsfcs = 0;

        }

        return ret;

    }

    return 1;

}

static int FUNC_0(struct AVFormatContext *VAR_0, const AVPacket *VAR_1)

{

    SegmentContext *seg = VAR_0->priv_data;

    AVFormatContext *VAR_2 = seg->avf;

    if (VAR_2->oformat->check_bitstream) {

        int VAR_3 = VAR_2->oformat->check_bitstream(VAR_2, VAR_1);

        if (VAR_3 == 1) {

            AVStream *st = VAR_0->streams[VAR_1->stream_index];

            AVStream *ost = VAR_2->streams[VAR_1->stream_index];

            st->internal->bsfcs = ost->internal->bsfcs;

            st->internal->nb_bsfcs = ost->internal->nb_bsfcs;

            ost->internal->bsfcs = NULL;

            ost->internal->nb_bsfcs = 0;

        }

        return VAR_3;

    }

    return 1;

}

static int FUNC_0(struct AVFormatContext *VAR_0, const AVPacket *VAR_1)
{ SegmentContext *seg = VAR_0->priv_data; AVFormatContext *VAR_2 = seg->avf; if (VAR_2->oformat->check_bitstream) { int VAR_3 = VAR_2->oformat->check_bitstream(VAR_2, VAR_1); if (VAR_3 == 1) { AVStream *st = VAR_0->streams[VAR_1->stream_index]; AVStream *ost = VAR_2->streams[VAR_1->stream_index]; st->internal->bsfcs = ost->internal->bsfcs; st->internal->nb_bsfcs = ost->internal->nb_bsfcs; ost->internal->bsfcs = NULL; ost->internal->nb_bsfcs = 0; } return VAR_3; } return 1; }