static int write_representation(AVFormatContext *s, AVStream *stream, int id,

                                int output_width, int output_height,

                                int output_sample_rate) {

    AVDictionaryEntry *irange = av_dict_get(stream->metadata, INITIALIZATION_RANGE, NULL, 0);

    AVDictionaryEntry *cues_start = av_dict_get(stream->metadata, CUES_START, NULL, 0);

    AVDictionaryEntry *cues_end = av_dict_get(stream->metadata, CUES_END, NULL, 0);

    AVDictionaryEntry *filename = av_dict_get(stream->metadata, FILENAME, NULL, 0);

    AVDictionaryEntry *bandwidth = av_dict_get(stream->metadata, BANDWIDTH, NULL, 0);

    if (!irange || cues_start == NULL || cues_end == NULL || filename == NULL ||

        !bandwidth) {

        return -1;

    }

    avio_printf(s->pb, "<Representation id=\"%d\"", id);

    avio_printf(s->pb, " bandwidth=\"%s\"", bandwidth->value);

    if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO && output_width)

        avio_printf(s->pb, " width=\"%d\"", stream->codec->width);

    if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO && output_height)

        avio_printf(s->pb, " height=\"%d\"", stream->codec->height);

    if (stream->codec->codec_type = AVMEDIA_TYPE_AUDIO && output_sample_rate)

        avio_printf(s->pb, " audioSamplingRate=\"%d\"", stream->codec->sample_rate);

    avio_printf(s->pb, ">\n");

    avio_printf(s->pb, "<BaseURL>%s</BaseURL>\n", filename->value);

    avio_printf(s->pb, "<SegmentBase\n");

    avio_printf(s->pb, "  indexRange=\"%s-%s\">\n", cues_start->value, cues_end->value);

    avio_printf(s->pb, "<Initialization\n");

    avio_printf(s->pb, "  range=\"0-%s\" />\n", irange->value);

    avio_printf(s->pb, "</SegmentBase>\n");

    avio_printf(s->pb, "</Representation>\n");

    return 0;

}

static int write_representation(AVFormatContext *s, AVStream *stream, int id,

                                int output_width, int output_height,

                                int output_sample_rate) {

    AVDictionaryEntry *irange = av_dict_get(stream->metadata, INITIALIZATION_RANGE, NULL, 0);

    AVDictionaryEntry *cues_start = av_dict_get(stream->metadata, CUES_START, NULL, 0);

    AVDictionaryEntry *cues_end = av_dict_get(stream->metadata, CUES_END, NULL, 0);

    AVDictionaryEntry *filename = av_dict_get(stream->metadata, FILENAME, NULL, 0);

    AVDictionaryEntry *bandwidth = av_dict_get(stream->metadata, BANDWIDTH, NULL, 0);

    if (!irange || cues_start == NULL || cues_end == NULL || filename == NULL ||

        !bandwidth) {

        return -1;

    }

    avio_printf(s->pb, "<Representation id=\"%d\"", id);

    avio_printf(s->pb, " bandwidth=\"%s\"", bandwidth->value);

    if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO && output_width)

        avio_printf(s->pb, " width=\"%d\"", stream->codec->width);

    if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO && output_height)

        avio_printf(s->pb, " height=\"%d\"", stream->codec->height);

    if (stream->codec->codec_type = AVMEDIA_TYPE_AUDIO && output_sample_rate)

        avio_printf(s->pb, " audioSamplingRate=\"%d\"", stream->codec->sample_rate);

    avio_printf(s->pb, ">\n");

    avio_printf(s->pb, "<BaseURL>%s</BaseURL>\n", filename->value);

    avio_printf(s->pb, "<SegmentBase\n");

    avio_printf(s->pb, "  indexRange=\"%s-%s\">\n", cues_start->value, cues_end->value);

    avio_printf(s->pb, "<Initialization\n");

    avio_printf(s->pb, "  range=\"0-%s\" />\n", irange->value);

    avio_printf(s->pb, "</SegmentBase>\n");

    avio_printf(s->pb, "</Representation>\n");

    return 0;

}

    avio_printf(s->pb, ">\n"); static int write_representation(AVFormatContext *s, AVStream *stream, int id,     if (!irange || cues_start == NULL || cues_end == NULL || filename == NULL ||         !bandwidth) {     avio_printf(s->pb, "<Representation id=\"%d\"", id);     avio_printf(s->pb, " bandwidth=\"%s\"", bandwidth->value);     avio_printf(s->pb, ">\n");     avio_printf(s->pb, "<BaseURL>%s</BaseURL>\n", filename->value);     avio_printf(s->pb, "<SegmentBase\n");     avio_printf(s->pb, "  indexRange=\"%s-%s\">\n", cues_start->value, cues_end->value);     avio_printf(s->pb, "<Initialization\n");     avio_printf(s->pb, "  range=\"0-%s\" />\n", irange->value);     avio_printf(s->pb, "</SegmentBase>\n");
static int FUNC_0(AVFormatContext *VAR_0, AVStream *VAR_1, int VAR_2,

                                int VAR_3, int VAR_4,

                                int VAR_5) {

    AVDictionaryEntry *irange = av_dict_get(VAR_1->metadata, INITIALIZATION_RANGE, NULL, 0);

    AVDictionaryEntry *cues_start = av_dict_get(VAR_1->metadata, CUES_START, NULL, 0);

    AVDictionaryEntry *cues_end = av_dict_get(VAR_1->metadata, CUES_END, NULL, 0);

    AVDictionaryEntry *filename = av_dict_get(VAR_1->metadata, FILENAME, NULL, 0);

    AVDictionaryEntry *bandwidth = av_dict_get(VAR_1->metadata, BANDWIDTH, NULL, 0);

    if (!irange || cues_start == NULL || cues_end == NULL || filename == NULL ||

        !bandwidth) {

        return -1;

    }

    avio_printf(VAR_0->pb, "<Representation VAR_2=\"%d\"", VAR_2);

    avio_printf(VAR_0->pb, " bandwidth=\"%VAR_0\"", bandwidth->value);

    if (VAR_1->codec->codec_type == AVMEDIA_TYPE_VIDEO && VAR_3)

        avio_printf(VAR_0->pb, " width=\"%d\"", VAR_1->codec->width);

    if (VAR_1->codec->codec_type == AVMEDIA_TYPE_VIDEO && VAR_4)

        avio_printf(VAR_0->pb, " height=\"%d\"", VAR_1->codec->height);

    if (VAR_1->codec->codec_type = AVMEDIA_TYPE_AUDIO && VAR_5)

        avio_printf(VAR_0->pb, " audioSamplingRate=\"%d\"", VAR_1->codec->sample_rate);

    avio_printf(VAR_0->pb, ">\n");

    avio_printf(VAR_0->pb, "<BaseURL>%VAR_0</BaseURL>\n", filename->value);

    avio_printf(VAR_0->pb, "<SegmentBase\n");

    avio_printf(VAR_0->pb, "  indexRange=\"%VAR_0-%VAR_0\">\n", cues_start->value, cues_end->value);

    avio_printf(VAR_0->pb, "<Initialization\n");

    avio_printf(VAR_0->pb, "  range=\"0-%VAR_0\" />\n", irange->value);

    avio_printf(VAR_0->pb, "</SegmentBase>\n");

    avio_printf(VAR_0->pb, "</Representation>\n");

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, AVStream *VAR_1, int VAR_2,
int VAR_3, int VAR_4,
int VAR_5) { AVDictionaryEntry *irange = av_dict_get(VAR_1->metadata, INITIALIZATION_RANGE, NULL, 0); AVDictionaryEntry *cues_start = av_dict_get(VAR_1->metadata, CUES_START, NULL, 0); AVDictionaryEntry *cues_end = av_dict_get(VAR_1->metadata, CUES_END, NULL, 0); AVDictionaryEntry *filename = av_dict_get(VAR_1->metadata, FILENAME, NULL, 0); AVDictionaryEntry *bandwidth = av_dict_get(VAR_1->metadata, BANDWIDTH, NULL, 0); if (!irange || cues_start == NULL || cues_end == NULL || filename == NULL ||
!bandwidth) { return -1; } avio_printf(VAR_0->pb, "<Representation VAR_2=\"%d\"", VAR_2); avio_printf(VAR_0->pb, " bandwidth=\"%VAR_0\"", bandwidth->value); if (VAR_1->codec->codec_type == AVMEDIA_TYPE_VIDEO && VAR_3)
avio_printf(VAR_0->pb, " width=\"%d\"", VAR_1->codec->width); if (VAR_1->codec->codec_type == AVMEDIA_TYPE_VIDEO && VAR_4)
avio_printf(VAR_0->pb, " height=\"%d\"", VAR_1->codec->height); if (VAR_1->codec->codec_type = AVMEDIA_TYPE_AUDIO && VAR_5)
avio_printf(VAR_0->pb, " audioSamplingRate=\"%d\"", VAR_1->codec->sample_rate); avio_printf(VAR_0->pb, ">\n"); avio_printf(VAR_0->pb, "<BaseURL>%VAR_0</BaseURL>\n", filename->value); avio_printf(VAR_0->pb, "<SegmentBase\n"); avio_printf(VAR_0->pb, "  indexRange=\"%VAR_0-%VAR_0\">\n", cues_start->value, cues_end->value); avio_printf(VAR_0->pb, "<Initialization\n"); avio_printf(VAR_0->pb, "  range=\"0-%VAR_0\" />\n", irange->value); avio_printf(VAR_0->pb, "</SegmentBase>\n"); avio_printf(VAR_0->pb, "</Representation>\n"); return 0; }