static int mov_read_udta_string(MOVContext *c, ByteIOContext *pb, MOVAtom atom)

{

    char *str = NULL;

    int size;

    uint16_t str_size;



    if (c->itunes_metadata) {

        int data_size = get_be32(pb);

        int tag = get_le32(pb);

        if (tag == MKTAG('d','a','t','a')) {

            get_be32(pb); // type

            get_be32(pb); // unknown

            str_size = data_size - 16;

        } else return 0;

    } else {

        str_size = get_be16(pb); // string length

        get_be16(pb); // language

    }

    switch (atom.type) {

    case MKTAG(0xa9,'n','a','m'):

        str = c->fc->title; size = sizeof(c->fc->title); break;

    case MKTAG(0xa9,'A','R','T'):

    case MKTAG(0xa9,'w','r','t'):

        str = c->fc->author; size = sizeof(c->fc->author); break;

    case MKTAG(0xa9,'c','p','y'):

        str = c->fc->copyright; size = sizeof(c->fc->copyright); break;

    case MKTAG(0xa9,'c','m','t'):

    case MKTAG(0xa9,'i','n','f'):

        str = c->fc->comment; size = sizeof(c->fc->comment); break;

    case MKTAG(0xa9,'a','l','b'):

        str = c->fc->album; size = sizeof(c->fc->album); break;

    }

    if (!str)

        return 0;

    get_buffer(pb, str, FFMIN(size, str_size));

    dprintf(c->fc, "%.4s %s\n", (char*)&atom.type, str);

    return 0;

}

static int mov_read_udta_string(MOVContext *c, ByteIOContext *pb, MOVAtom atom)

{

    char *str = NULL;

    int size;

    uint16_t str_size;



    if (c->itunes_metadata) {

        int data_size = get_be32(pb);

        int tag = get_le32(pb);

        if (tag == MKTAG('d','a','t','a')) {

            get_be32(pb); 

            get_be32(pb); 

            str_size = data_size - 16;

        } else return 0;

    } else {

        str_size = get_be16(pb); 

        get_be16(pb); 

    }

    switch (atom.type) {

    case MKTAG(0xa9,'n','a','m'):

        str = c->fc->title; size = sizeof(c->fc->title); break;

    case MKTAG(0xa9,'A','R','T'):

    case MKTAG(0xa9,'w','r','t'):

        str = c->fc->author; size = sizeof(c->fc->author); break;

    case MKTAG(0xa9,'c','p','y'):

        str = c->fc->copyright; size = sizeof(c->fc->copyright); break;

    case MKTAG(0xa9,'c','m','t'):

    case MKTAG(0xa9,'i','n','f'):

        str = c->fc->comment; size = sizeof(c->fc->comment); break;

    case MKTAG(0xa9,'a','l','b'):

        str = c->fc->album; size = sizeof(c->fc->album); break;

    }

    if (!str)

        return 0;

    get_buffer(pb, str, FFMIN(size, str_size));

    dprintf(c->fc, "%.4s %s\n", (char*)&atom.type, str);

    return 0;

}

static int FUNC_0(MOVContext *VAR_0, ByteIOContext *VAR_1, MOVAtom VAR_2)

{

    char *VAR_3 = NULL;

    int VAR_4;

    uint16_t str_size;



    if (VAR_0->itunes_metadata) {

        int VAR_5 = get_be32(VAR_1);

        int VAR_6 = get_le32(VAR_1);

        if (VAR_6 == MKTAG('d','a','t','a')) {

            get_be32(VAR_1); 

            get_be32(VAR_1); 

            str_size = VAR_5 - 16;

        } else return 0;

    } else {

        str_size = get_be16(VAR_1); 

        get_be16(VAR_1); 

    }

    switch (VAR_2.type) {

    case MKTAG(0xa9,'n','a','m'):

        VAR_3 = VAR_0->fc->title; VAR_4 = sizeof(VAR_0->fc->title); break;

    case MKTAG(0xa9,'A','R','T'):

    case MKTAG(0xa9,'w','r','t'):

        VAR_3 = VAR_0->fc->author; VAR_4 = sizeof(VAR_0->fc->author); break;

    case MKTAG(0xa9,'VAR_0','p','y'):

        VAR_3 = VAR_0->fc->copyright; VAR_4 = sizeof(VAR_0->fc->copyright); break;

    case MKTAG(0xa9,'VAR_0','m','t'):

    case MKTAG(0xa9,'i','n','f'):

        VAR_3 = VAR_0->fc->comment; VAR_4 = sizeof(VAR_0->fc->comment); break;

    case MKTAG(0xa9,'a','l','b'):

        VAR_3 = VAR_0->fc->album; VAR_4 = sizeof(VAR_0->fc->album); break;

    }

    if (!VAR_3)

        return 0;

    get_buffer(VAR_1, VAR_3, FFMIN(VAR_4, str_size));

    dprintf(VAR_0->fc, "%.4s %s\n", (char*)&VAR_2.type, VAR_3);

    return 0;

}

static int FUNC_0(MOVContext *VAR_0, ByteIOContext *VAR_1, MOVAtom VAR_2)
{ char *VAR_3 = NULL; int VAR_4; uint16_t str_size; if (VAR_0->itunes_metadata) { int VAR_5 = get_be32(VAR_1); int VAR_6 = get_le32(VAR_1); if (VAR_6 == MKTAG('d','a','t','a')) { get_be32(VAR_1); get_be32(VAR_1); str_size = VAR_5 - 16; } else return 0; } else { str_size = get_be16(VAR_1); get_be16(VAR_1); } switch (VAR_2.type) { case MKTAG(0xa9,'n','a','m'):
VAR_3 = VAR_0->fc->title; VAR_4 = sizeof(VAR_0->fc->title); break; case MKTAG(0xa9,'A','R','T'):
case MKTAG(0xa9,'w','r','t'):
VAR_3 = VAR_0->fc->author; VAR_4 = sizeof(VAR_0->fc->author); break; case MKTAG(0xa9,'VAR_0','p','y'):
VAR_3 = VAR_0->fc->copyright; VAR_4 = sizeof(VAR_0->fc->copyright); break; case MKTAG(0xa9,'VAR_0','m','t'):
case MKTAG(0xa9,'i','n','f'):
VAR_3 = VAR_0->fc->comment; VAR_4 = sizeof(VAR_0->fc->comment); break; case MKTAG(0xa9,'a','l','b'):
VAR_3 = VAR_0->fc->album; VAR_4 = sizeof(VAR_0->fc->album); break; } if (!VAR_3)
return 0; get_buffer(VAR_1, VAR_3, FFMIN(VAR_4, str_size)); dprintf(VAR_0->fc, "%.4s %s\n", (char*)&VAR_2.type, VAR_3); return 0; }