static double compute_target_delay(double delay, VideoState *is)

{

    double sync_threshold, diff;



    /* update delay to follow master synchronisation source */

    if (get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER) {

        /* if video is slave, we try to correct big delays by

           duplicating or deleting a frame */

        diff = get_video_clock(is) - get_master_clock(is);



        /* skip or repeat frame. We take into account the

           delay to compute the threshold. I still don't know

           if it is the best guess */

        sync_threshold = FFMAX(AV_SYNC_THRESHOLD, delay);

        if (fabs(diff) < AV_NOSYNC_THRESHOLD) {

            if (diff <= -sync_threshold)

                delay = 0;

            else if (diff >= sync_threshold)

                delay = 2 * delay;

        }

    }



    av_dlog(NULL, "video: delay=%0.3f A-V=%f\n",

            delay, -diff);



    return delay;

}

static double compute_target_delay(double delay, VideoState *is)

{

    double sync_threshold, diff;



    

    if (get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER) {

        



        diff = get_video_clock(is) - get_master_clock(is);



        





        sync_threshold = FFMAX(AV_SYNC_THRESHOLD, delay);

        if (fabs(diff) < AV_NOSYNC_THRESHOLD) {

            if (diff <= -sync_threshold)

                delay = 0;

            else if (diff >= sync_threshold)

                delay = 2 * delay;

        }

    }



    av_dlog(NULL, "video: delay=%0.3f A-V=%f\n",

            delay, -diff);



    return delay;

}

static double FUNC_0(double VAR_0, VideoState *VAR_1)

{

    double VAR_2, VAR_3;



    

    if (get_master_sync_type(VAR_1) != AV_SYNC_VIDEO_MASTER) {

        



        VAR_3 = get_video_clock(VAR_1) - get_master_clock(VAR_1);



        





        VAR_2 = FFMAX(AV_SYNC_THRESHOLD, VAR_0);

        if (fabs(VAR_3) < AV_NOSYNC_THRESHOLD) {

            if (VAR_3 <= -VAR_2)

                VAR_0 = 0;

            else if (VAR_3 >= VAR_2)

                VAR_0 = 2 * VAR_0;

        }

    }



    av_dlog(NULL, "video: VAR_0=%0.3f A-V=%f\n",

            VAR_0, -VAR_3);



    return VAR_0;

}

static double FUNC_0(double VAR_0, VideoState *VAR_1)
{ double VAR_2, VAR_3; if (get_master_sync_type(VAR_1) != AV_SYNC_VIDEO_MASTER) { VAR_3 = get_video_clock(VAR_1) - get_master_clock(VAR_1); VAR_2 = FFMAX(AV_SYNC_THRESHOLD, VAR_0); if (fabs(VAR_3) < AV_NOSYNC_THRESHOLD) { if (VAR_3 <= -VAR_2)
VAR_0 = 0; else if (VAR_3 >= VAR_2)
VAR_0 = 2 * VAR_0; } } av_dlog(NULL, "video: VAR_0=%0.3f A-V=%f\n",
VAR_0, -VAR_3); return VAR_0; }