GF_Err ssix_box_dump(GF_Box *a, FILE * trace)
{
	u32 i, j;
	GF_SubsegmentIndexBox *p = (GF_SubsegmentIndexBox *)a;
	gf_isom_box_dump_start(a, "SubsegmentIndexBox", trace);

	gf_fprintf(trace, "subsegment_count=\"%d\"", p->subsegment_count);
	if (p->internal_flags & GF_ISOM_BOX_COMPRESSED)
		gf_fprintf(trace, " compressedSize=\""LLU"\"", p->size - p->compressed_diff);
	gf_fprintf(trace, ">\n");

	for (i = 0; i < p->subsegment_count; i++) {
		gf_fprintf(trace, "<Subsegment range_count=\"%d\">\n", p->subsegments[i].range_count);
		for (j = 0; j < p->subsegments[i].range_count; j++) {
			gf_fprintf(trace, "<Range level=\"%d\" range_size=\"%d\"/>\n", p->subsegments[i].ranges[j].level, p->subsegments[i].ranges[j].range_size);
		}
		gf_fprintf(trace, "</Subsegment>\n");
	}
	if (!p->size) {
		gf_fprintf(trace, "<Subsegment range_count=\"\">\n");
		gf_fprintf(trace, "<Range level=\"\" range_size=\"\"/>\n");
		gf_fprintf(trace, "</Subsegment>\n");
	}
	gf_isom_box_dump_done("SubsegmentIndexBox", a, trace);
	return GF_OK;
}
GF_Err ssix_box_dump(GF_Box *a, FILE * trace)
{
	u32 i, j;
	GF_SubsegmentIndexBox *p = (GF_SubsegmentIndexBox *)a;
	gf_isom_box_dump_start(a, "SubsegmentIndexBox", trace);

	gf_fprintf(trace, "subsegment_count=\"%d\"", p->subsegment_count);
	if (p->internal_flags & GF_ISOM_BOX_COMPRESSED)
		gf_fprintf(trace, " compressedSize=\""LLU"\"", p->size - p->compressed_diff);
	gf_fprintf(trace, ">\n");

	for (i = 0; i < p->subsegment_count; i++) {
		gf_fprintf(trace, "<Subsegment range_count=\"%d\">\n", p->subsegments[i].range_count);
		for (j = 0; j < p->subsegments[i].range_count; j++) {
			gf_fprintf(trace, "<Range level=\"%d\" range_size=\"%d\"/>\n", p->subsegments[i].ranges[j].level, p->subsegments[i].ranges[j].range_size);
		}
		gf_fprintf(trace, "</Subsegment>\n");
	}
	if (!p->size) {
		gf_fprintf(trace, "<Subsegment range_count=\"\">\n");
		gf_fprintf(trace, "<Range level=\"\" range_size=\"\"/>\n");
		gf_fprintf(trace, "</Subsegment>\n");
	}
	gf_isom_box_dump_done("SubsegmentIndexBox", a, trace);
	return GF_OK;
}