static int get_video_frame(VideoState *is, AVFrame *frame)

{

    int got_picture;



    if ((got_picture = decoder_decode_frame(&is->viddec, frame)) < 0)

        return -1;



    if (got_picture) {

        double dpts = NAN;



        if (frame->pts != AV_NOPTS_VALUE)

            dpts = av_q2d(is->video_st->time_base) * frame->pts;



        frame->sample_aspect_ratio = av_guess_sample_aspect_ratio(is->ic, is->video_st, frame);



        if (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) {

            if (frame->pts != AV_NOPTS_VALUE) {

                double diff = dpts - get_master_clock(is);

                if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD &&

                    diff - is->frame_last_filter_delay < 0 &&

                    is->viddec.pkt_serial == is->vidclk.serial &&

                    is->videoq.nb_packets) {

                    is->frame_drops_early++;

                    av_frame_unref(frame);

                    got_picture = 0;

                }

            }

        }

    }



    return got_picture;

}

static int get_video_frame(VideoState *is, AVFrame *frame)

{

    int got_picture;



    if ((got_picture = decoder_decode_frame(&is->viddec, frame)) < 0)

        return -1;



    if (got_picture) {

        double dpts = NAN;



        if (frame->pts != AV_NOPTS_VALUE)

            dpts = av_q2d(is->video_st->time_base) * frame->pts;



        frame->sample_aspect_ratio = av_guess_sample_aspect_ratio(is->ic, is->video_st, frame);



        if (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) {

            if (frame->pts != AV_NOPTS_VALUE) {

                double diff = dpts - get_master_clock(is);

                if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD &&

                    diff - is->frame_last_filter_delay < 0 &&

                    is->viddec.pkt_serial == is->vidclk.serial &&

                    is->videoq.nb_packets) {

                    is->frame_drops_early++;

                    av_frame_unref(frame);

                    got_picture = 0;

                }

            }

        }

    }



    return got_picture;

}

    if ((got_picture = decoder_decode_frame(&is->viddec, frame)) < 0)
static int FUNC_0(VideoState *VAR_0, AVFrame *VAR_1)

{

    int VAR_2;



    if ((VAR_2 = decoder_decode_frame(&VAR_0->viddec, VAR_1)) < 0)

        return -1;



    if (VAR_2) {

        double VAR_3 = NAN;



        if (VAR_1->pts != AV_NOPTS_VALUE)

            VAR_3 = av_q2d(VAR_0->video_st->time_base) * VAR_1->pts;



        VAR_1->sample_aspect_ratio = av_guess_sample_aspect_ratio(VAR_0->ic, VAR_0->video_st, VAR_1);



        if (framedrop>0 || (framedrop && get_master_sync_type(VAR_0) != AV_SYNC_VIDEO_MASTER)) {

            if (VAR_1->pts != AV_NOPTS_VALUE) {

                double VAR_4 = VAR_3 - get_master_clock(VAR_0);

                if (!isnan(VAR_4) && fabs(VAR_4) < AV_NOSYNC_THRESHOLD &&

                    VAR_4 - VAR_0->frame_last_filter_delay < 0 &&

                    VAR_0->viddec.pkt_serial == VAR_0->vidclk.serial &&

                    VAR_0->videoq.nb_packets) {

                    VAR_0->frame_drops_early++;

                    av_frame_unref(VAR_1);

                    VAR_2 = 0;

                }

            }

        }

    }



    return VAR_2;

}

static int FUNC_0(VideoState *VAR_0, AVFrame *VAR_1)
{ int VAR_2; if ((VAR_2 = decoder_decode_frame(&VAR_0->viddec, VAR_1)) < 0)
return -1; if (VAR_2) { double VAR_3 = NAN; if (VAR_1->pts != AV_NOPTS_VALUE)
VAR_3 = av_q2d(VAR_0->video_st->time_base) * VAR_1->pts; VAR_1->sample_aspect_ratio = av_guess_sample_aspect_ratio(VAR_0->ic, VAR_0->video_st, VAR_1); if (framedrop>0 || (framedrop && get_master_sync_type(VAR_0) != AV_SYNC_VIDEO_MASTER)) { if (VAR_1->pts != AV_NOPTS_VALUE) { double VAR_4 = VAR_3 - get_master_clock(VAR_0); if (!isnan(VAR_4) && fabs(VAR_4) < AV_NOSYNC_THRESHOLD &&
VAR_4 - VAR_0->frame_last_filter_delay < 0 &&
VAR_0->viddec.pkt_serial == VAR_0->vidclk.serial &&
VAR_0->videoq.nb_packets) { VAR_0->frame_drops_early++; av_frame_unref(VAR_1); VAR_2 = 0; } } } } return VAR_2; }