static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom)

{

    uint32_t minor_ver;

    int comp_brand_size;

    char minor_ver_str[11]; /* 32 bit integer -> 10 digits + null */

    char* comp_brands_str;

    uint8_t type[5] = {0};



    avio_read(pb, type, 4);

    if (strcmp(type, "qt  "))

        c->isom = 1;

    av_log(c->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type);

    av_dict_set(&c->fc->metadata, "major_brand", type, 0);

    minor_ver = avio_rb32(pb); /* minor version */

    snprintf(minor_ver_str, sizeof(minor_ver_str), "%"PRIu32"", minor_ver);

    av_dict_set(&c->fc->metadata, "minor_version", minor_ver_str, 0);



    comp_brand_size = atom.size - 8;

    if (comp_brand_size < 0)

        return AVERROR_INVALIDDATA;

    comp_brands_str = av_malloc(comp_brand_size + 1); /* Add null terminator */

    if (!comp_brands_str)

        return AVERROR(ENOMEM);

    avio_read(pb, comp_brands_str, comp_brand_size);

    comp_brands_str[comp_brand_size] = 0;

    av_dict_set(&c->fc->metadata, "compatible_brands", comp_brands_str, 0);

    av_freep(&comp_brands_str);



    return 0;

}

static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom)

{

    uint32_t minor_ver;

    int comp_brand_size;

    char minor_ver_str[11]; 

    char* comp_brands_str;

    uint8_t type[5] = {0};



    avio_read(pb, type, 4);

    if (strcmp(type, "qt  "))

        c->isom = 1;

    av_log(c->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type);

    av_dict_set(&c->fc->metadata, "major_brand", type, 0);

    minor_ver = avio_rb32(pb); 

    snprintf(minor_ver_str, sizeof(minor_ver_str), "%"PRIu32"", minor_ver);

    av_dict_set(&c->fc->metadata, "minor_version", minor_ver_str, 0);



    comp_brand_size = atom.size - 8;

    if (comp_brand_size < 0)

        return AVERROR_INVALIDDATA;

    comp_brands_str = av_malloc(comp_brand_size + 1); 

    if (!comp_brands_str)

        return AVERROR(ENOMEM);

    avio_read(pb, comp_brands_str, comp_brand_size);

    comp_brands_str[comp_brand_size] = 0;

    av_dict_set(&c->fc->metadata, "compatible_brands", comp_brands_str, 0);

    av_freep(&comp_brands_str);



    return 0;

}

    avio_read(pb, type, 4);     avio_read(pb, comp_brands_str, comp_brand_size);         return AVERROR_INVALIDDATA;
static int FUNC_0(MOVContext *VAR_0, AVIOContext *VAR_1, MOVAtom VAR_2)

{

    uint32_t minor_ver;

    int VAR_3;

    char VAR_4[11]; 

    char* VAR_5;

    uint8_t type[5] = {0};



    avio_read(VAR_1, type, 4);

    if (strcmp(type, "qt  "))

        VAR_0->isom = 1;

    av_log(VAR_0->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type);

    av_dict_set(&VAR_0->fc->metadata, "major_brand", type, 0);

    minor_ver = avio_rb32(VAR_1); 

    snprintf(VAR_4, sizeof(VAR_4), "%"PRIu32"", minor_ver);

    av_dict_set(&VAR_0->fc->metadata, "minor_version", VAR_4, 0);



    VAR_3 = VAR_2.size - 8;

    if (VAR_3 < 0)

        return AVERROR_INVALIDDATA;

    VAR_5 = av_malloc(VAR_3 + 1); 

    if (!VAR_5)

        return AVERROR(ENOMEM);

    avio_read(VAR_1, VAR_5, VAR_3);

    VAR_5[VAR_3] = 0;

    av_dict_set(&VAR_0->fc->metadata, "compatible_brands", VAR_5, 0);

    av_freep(&VAR_5);



    return 0;

}

static int FUNC_0(MOVContext *VAR_0, AVIOContext *VAR_1, MOVAtom VAR_2)
{ uint32_t minor_ver; int VAR_3; char VAR_4[11]; char* VAR_5; uint8_t type[5] = {0}; avio_read(VAR_1, type, 4); if (strcmp(type, "qt  "))
VAR_0->isom = 1; av_log(VAR_0->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type); av_dict_set(&VAR_0->fc->metadata, "major_brand", type, 0); minor_ver = avio_rb32(VAR_1); snprintf(VAR_4, sizeof(VAR_4), "%"PRIu32"", minor_ver); av_dict_set(&VAR_0->fc->metadata, "minor_version", VAR_4, 0); VAR_3 = VAR_2.size - 8; if (VAR_3 < 0)
return AVERROR_INVALIDDATA; VAR_5 = av_malloc(VAR_3 + 1); if (!VAR_5)
return AVERROR(ENOMEM); avio_read(VAR_1, VAR_5, VAR_3); VAR_5[VAR_3] = 0; av_dict_set(&VAR_0->fc->metadata, "compatible_brands", VAR_5, 0); av_freep(&VAR_5); return 0; }