static int swf_write_audio(AVFormatContext *s, 

                           AVCodecContext *enc, const uint8_t *buf, int size)

{

    SWFContext *swf = s->priv_data;

    int c = 0;



    /* Flash Player limit */

    if ( swf->swf_frame_number >= 16000 ) {

        return 0;

    }



    if (enc->codec_id == CODEC_ID_MP3 ) {

        for (c=0; c<size; c++) {

            swf->audio_fifo[(swf->audio_out_pos+c)%AUDIO_FIFO_SIZE] = buf[c];

        }

        swf->audio_size += size;

        swf->audio_out_pos += size;

        swf->audio_out_pos %= AUDIO_FIFO_SIZE;

    }



    /* if audio only stream make sure we add swf frames */

    if ( swf->video_type == 0 ) {

        swf_write_video(s, enc, 0, 0);

    }



    return 0;

}

static int swf_write_audio(AVFormatContext *s, 

                           AVCodecContext *enc, const uint8_t *buf, int size)

{

    SWFContext *swf = s->priv_data;

    int c = 0;



    

    if ( swf->swf_frame_number >= 16000 ) {

        return 0;

    }



    if (enc->codec_id == CODEC_ID_MP3 ) {

        for (c=0; c<size; c++) {

            swf->audio_fifo[(swf->audio_out_pos+c)%AUDIO_FIFO_SIZE] = buf[c];

        }

        swf->audio_size += size;

        swf->audio_out_pos += size;

        swf->audio_out_pos %= AUDIO_FIFO_SIZE;

    }



    

    if ( swf->video_type == 0 ) {

        swf_write_video(s, enc, 0, 0);

    }



    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, 

                           AVCodecContext *VAR_1, const uint8_t *VAR_2, int VAR_3)

{

    SWFContext *swf = VAR_0->priv_data;

    int VAR_4 = 0;



    

    if ( swf->swf_frame_number >= 16000 ) {

        return 0;

    }



    if (VAR_1->codec_id == CODEC_ID_MP3 ) {

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

            swf->audio_fifo[(swf->audio_out_pos+VAR_4)%AUDIO_FIFO_SIZE] = VAR_2[VAR_4];

        }

        swf->audio_size += VAR_3;

        swf->audio_out_pos += VAR_3;

        swf->audio_out_pos %= AUDIO_FIFO_SIZE;

    }



    

    if ( swf->video_type == 0 ) {

        swf_write_video(VAR_0, VAR_1, 0, 0);

    }



    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0,
AVCodecContext *VAR_1, const uint8_t *VAR_2, int VAR_3)
{ SWFContext *swf = VAR_0->priv_data; int VAR_4 = 0; if ( swf->swf_frame_number >= 16000 ) { return 0; } if (VAR_1->codec_id == CODEC_ID_MP3 ) { for (VAR_4=0; VAR_4<VAR_3; VAR_4++) { swf->audio_fifo[(swf->audio_out_pos+VAR_4)%AUDIO_FIFO_SIZE] = VAR_2[VAR_4]; } swf->audio_size += VAR_3; swf->audio_out_pos += VAR_3; swf->audio_out_pos %= AUDIO_FIFO_SIZE; } if ( swf->video_type == 0 ) { swf_write_video(VAR_0, VAR_1, 0, 0); } return 0; }