static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack *track)

{

    const char *descr, *hdlr, *hdlr_type;

    int64_t pos = url_ftell(pb);



    if (!track) { /* no media --> data handler */

        hdlr = "dhlr";

        hdlr_type = "url ";

        descr = "DataHandler";

    } else {

        hdlr = (track->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0";

        if (track->enc->codec_type == CODEC_TYPE_VIDEO) {

            hdlr_type = "vide";

            descr = "VideoHandler";

        } else if (track->enc->codec_type == CODEC_TYPE_AUDIO){

            hdlr_type = "soun";

            descr = "SoundHandler";

        } else if (track->enc->codec_type == CODEC_TYPE_SUBTITLE){

            if (track->mode == MODE_IPOD) hdlr_type = "sbtl";

            else                          hdlr_type = "text";

            descr = "SubtitleHandler";

        }

    }



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

    put_tag(pb, "hdlr");

    put_be32(pb, 0); /* Version & flags */

    put_buffer(pb, hdlr, 4); /* handler */

    put_tag(pb, hdlr_type); /* handler type */

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

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

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

    put_byte(pb, strlen(descr)); /* string counter */

    put_buffer(pb, descr, strlen(descr)); /* handler description */

    return updateSize(pb, pos);

}

static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack *track)

{

    const char *descr, *hdlr, *hdlr_type;

    int64_t pos = url_ftell(pb);



    if (!track) { 

        hdlr = "dhlr";

        hdlr_type = "url ";

        descr = "DataHandler";

    } else {

        hdlr = (track->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0";

        if (track->enc->codec_type == CODEC_TYPE_VIDEO) {

            hdlr_type = "vide";

            descr = "VideoHandler";

        } else if (track->enc->codec_type == CODEC_TYPE_AUDIO){

            hdlr_type = "soun";

            descr = "SoundHandler";

        } else if (track->enc->codec_type == CODEC_TYPE_SUBTITLE){

            if (track->mode == MODE_IPOD) hdlr_type = "sbtl";

            else                          hdlr_type = "text";

            descr = "SubtitleHandler";

        }

    }



    put_be32(pb, 0); 

    put_tag(pb, "hdlr");

    put_be32(pb, 0); 

    put_buffer(pb, hdlr, 4); 

    put_tag(pb, hdlr_type); 

    put_be32(pb ,0); 

    put_be32(pb ,0); 

    put_be32(pb ,0); 

    put_byte(pb, strlen(descr)); 

    put_buffer(pb, descr, strlen(descr)); 

    return updateSize(pb, pos);

}

    const char *descr, *hdlr, *hdlr_type;
static int FUNC_0(ByteIOContext *VAR_0, MOVTrack *VAR_1)

{

    const char *VAR_2, *VAR_3, *VAR_4;

    int64_t pos = url_ftell(VAR_0);



    if (!VAR_1) { 

        VAR_3 = "dhlr";

        VAR_4 = "url ";

        VAR_2 = "DataHandler";

    } else {

        VAR_3 = (VAR_1->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0";

        if (VAR_1->enc->codec_type == CODEC_TYPE_VIDEO) {

            VAR_4 = "vide";

            VAR_2 = "VideoHandler";

        } else if (VAR_1->enc->codec_type == CODEC_TYPE_AUDIO){

            VAR_4 = "soun";

            VAR_2 = "SoundHandler";

        } else if (VAR_1->enc->codec_type == CODEC_TYPE_SUBTITLE){

            if (VAR_1->mode == MODE_IPOD) VAR_4 = "sbtl";

            else                          VAR_4 = "text";

            VAR_2 = "SubtitleHandler";

        }

    }



    put_be32(VAR_0, 0); 

    put_tag(VAR_0, "VAR_3");

    put_be32(VAR_0, 0); 

    put_buffer(VAR_0, VAR_3, 4); 

    put_tag(VAR_0, VAR_4); 

    put_be32(VAR_0 ,0); 

    put_be32(VAR_0 ,0); 

    put_be32(VAR_0 ,0); 

    put_byte(VAR_0, strlen(VAR_2)); 

    put_buffer(VAR_0, VAR_2, strlen(VAR_2)); 

    return updateSize(VAR_0, pos);

}

static int FUNC_0(ByteIOContext *VAR_0, MOVTrack *VAR_1)
{ const char *VAR_2, *VAR_3, *VAR_4; int64_t pos = url_ftell(VAR_0); if (!VAR_1) { VAR_3 = "dhlr"; VAR_4 = "url "; VAR_2 = "DataHandler"; } else { VAR_3 = (VAR_1->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0"; if (VAR_1->enc->codec_type == CODEC_TYPE_VIDEO) { VAR_4 = "vide"; VAR_2 = "VideoHandler"; } else if (VAR_1->enc->codec_type == CODEC_TYPE_AUDIO){ VAR_4 = "soun"; VAR_2 = "SoundHandler"; } else if (VAR_1->enc->codec_type == CODEC_TYPE_SUBTITLE){ if (VAR_1->mode == MODE_IPOD) VAR_4 = "sbtl"; else                          VAR_4 = "text"; VAR_2 = "SubtitleHandler"; } } put_be32(VAR_0, 0); put_tag(VAR_0, "VAR_3"); put_be32(VAR_0, 0); put_buffer(VAR_0, VAR_3, 4); put_tag(VAR_0, VAR_4); put_be32(VAR_0 ,0); put_be32(VAR_0 ,0); put_be32(VAR_0 ,0); put_byte(VAR_0, strlen(VAR_2)); put_buffer(VAR_0, VAR_2, strlen(VAR_2)); return updateSize(VAR_0, pos); }