static int mov_write_udta_tag(ByteIOContext *pb, MOVContext* mov,

                              AVFormatContext *s)

{

    offset_t pos = url_ftell(pb);

    int i;



    put_be32(pb, 0); /* size */

    put_tag(pb, "udta");



    /* iTunes meta data */

    mov_write_meta_tag(pb, mov, s);



  if(mov->mode == MODE_MOV){ // the title field breaks gtkpod with mp4 and my suspicion is that stuff isnt valid in mp4

    /* Requirements */

    for (i=0; i<MAX_STREAMS; i++) {

        if(mov->tracks[i].entry <= 0) continue;

        if (mov->tracks[i].enc->codec_id == CODEC_ID_AAC ||

            mov->tracks[i].enc->codec_id == CODEC_ID_MPEG4) {

            mov_write_string_tag(pb, "\251req", "QuickTime 6.0 or greater", 0);

            break;

        }

    }



    mov_write_string_tag(pb, "\251nam", s->title         , 0);

    mov_write_string_tag(pb, "\251aut", s->author        , 0);

    mov_write_string_tag(pb, "\251alb", s->album         , 0);

    mov_write_day_tag(pb, s->year, 0);

    if(mov->tracks[0].enc && !(mov->tracks[0].enc->flags & CODEC_FLAG_BITEXACT))

        mov_write_string_tag(pb, "\251enc", LIBAVFORMAT_IDENT, 0);

    mov_write_string_tag(pb, "\251des", s->comment       , 0);

    mov_write_string_tag(pb, "\251gen", s->genre         , 0);

  }



    return updateSize(pb, pos);

}

static int mov_write_udta_tag(ByteIOContext *pb, MOVContext* mov,

                              AVFormatContext *s)

{

    offset_t pos = url_ftell(pb);

    int i;



    put_be32(pb, 0); 

    put_tag(pb, "udta");



    

    mov_write_meta_tag(pb, mov, s);



  if(mov->mode == MODE_MOV){ 

    

    for (i=0; i<MAX_STREAMS; i++) {

        if(mov->tracks[i].entry <= 0) continue;

        if (mov->tracks[i].enc->codec_id == CODEC_ID_AAC ||

            mov->tracks[i].enc->codec_id == CODEC_ID_MPEG4) {

            mov_write_string_tag(pb, "\251req", "QuickTime 6.0 or greater", 0);

            break;

        }

    }



    mov_write_string_tag(pb, "\251nam", s->title         , 0);

    mov_write_string_tag(pb, "\251aut", s->author        , 0);

    mov_write_string_tag(pb, "\251alb", s->album         , 0);

    mov_write_day_tag(pb, s->year, 0);

    if(mov->tracks[0].enc && !(mov->tracks[0].enc->flags & CODEC_FLAG_BITEXACT))

        mov_write_string_tag(pb, "\251enc", LIBAVFORMAT_IDENT, 0);

    mov_write_string_tag(pb, "\251des", s->comment       , 0);

    mov_write_string_tag(pb, "\251gen", s->genre         , 0);

  }



    return updateSize(pb, pos);

}

static int FUNC_0(ByteIOContext *VAR_0, MOVContext* VAR_1,

                              AVFormatContext *VAR_2)

{

    offset_t pos = url_ftell(VAR_0);

    int VAR_3;



    put_be32(VAR_0, 0); 

    put_tag(VAR_0, "udta");



    

    mov_write_meta_tag(VAR_0, VAR_1, VAR_2);



  if(VAR_1->mode == MODE_MOV){ 

    

    for (VAR_3=0; VAR_3<MAX_STREAMS; VAR_3++) {

        if(VAR_1->tracks[VAR_3].entry <= 0) continue;

        if (VAR_1->tracks[VAR_3].enc->codec_id == CODEC_ID_AAC ||

            VAR_1->tracks[VAR_3].enc->codec_id == CODEC_ID_MPEG4) {

            mov_write_string_tag(VAR_0, "\251req", "QuickTime 6.0 or greater", 0);

            break;

        }

    }



    mov_write_string_tag(VAR_0, "\251nam", VAR_2->title         , 0);

    mov_write_string_tag(VAR_0, "\251aut", VAR_2->author        , 0);

    mov_write_string_tag(VAR_0, "\251alb", VAR_2->album         , 0);

    mov_write_day_tag(VAR_0, VAR_2->year, 0);

    if(VAR_1->tracks[0].enc && !(VAR_1->tracks[0].enc->flags & CODEC_FLAG_BITEXACT))

        mov_write_string_tag(VAR_0, "\251enc", LIBAVFORMAT_IDENT, 0);

    mov_write_string_tag(VAR_0, "\251des", VAR_2->comment       , 0);

    mov_write_string_tag(VAR_0, "\251gen", VAR_2->genre         , 0);

  }



    return updateSize(VAR_0, pos);

}

static int FUNC_0(ByteIOContext *VAR_0, MOVContext* VAR_1,
AVFormatContext *VAR_2)
{ offset_t pos = url_ftell(VAR_0); int VAR_3; put_be32(VAR_0, 0); put_tag(VAR_0, "udta"); mov_write_meta_tag(VAR_0, VAR_1, VAR_2); if(VAR_1->mode == MODE_MOV){ for (VAR_3=0; VAR_3<MAX_STREAMS; VAR_3++) { if(VAR_1->tracks[VAR_3].entry <= 0) continue; if (VAR_1->tracks[VAR_3].enc->codec_id == CODEC_ID_AAC ||
VAR_1->tracks[VAR_3].enc->codec_id == CODEC_ID_MPEG4) { mov_write_string_tag(VAR_0, "\251req", "QuickTime 6.0 or greater", 0); break; } } mov_write_string_tag(VAR_0, "\251nam", VAR_2->title         , 0); mov_write_string_tag(VAR_0, "\251aut", VAR_2->author        , 0); mov_write_string_tag(VAR_0, "\251alb", VAR_2->album         , 0); mov_write_day_tag(VAR_0, VAR_2->year, 0); if(VAR_1->tracks[0].enc && !(VAR_1->tracks[0].enc->flags & CODEC_FLAG_BITEXACT))
mov_write_string_tag(VAR_0, "\251enc", LIBAVFORMAT_IDENT, 0); mov_write_string_tag(VAR_0, "\251des", VAR_2->comment       , 0); mov_write_string_tag(VAR_0, "\251gen", VAR_2->genre         , 0); } return updateSize(VAR_0, pos); }