static void compute_frame_duration(int *pnum, int *pden, AVStream *st,

                                   AVCodecParserContext *pc, AVPacket *pkt)

{

    int frame_size;



    *pnum = 0;

    *pden = 0;

    switch(st->codec->codec_type) {

    case AVMEDIA_TYPE_VIDEO:

        if (st->r_frame_rate.num) {

            *pnum = st->r_frame_rate.den;

            *pden = st->r_frame_rate.num;

        } else if(st->time_base.num*1000LL > st->time_base.den) {

            *pnum = st->time_base.num;

            *pden = st->time_base.den;

        }else if(st->codec->time_base.num*1000LL > st->codec->time_base.den){

            *pnum = st->codec->time_base.num;

            *pden = st->codec->time_base.den;

            if (pc && pc->repeat_pict) {

                *pnum = (*pnum) * (1 + pc->repeat_pict);

            }

            //If this codec can be interlaced or progressive then we need a parser to compute duration of a packet

            //Thus if we have no parser in such case leave duration undefined.

            if(st->codec->ticks_per_frame>1 && !pc){

                *pnum = *pden = 0;

            }

        }

        break;

    case AVMEDIA_TYPE_AUDIO:

        frame_size = get_audio_frame_size(st->codec, pkt->size, 0);

        if (frame_size <= 0 || st->codec->sample_rate <= 0)

            break;

        *pnum = frame_size;

        *pden = st->codec->sample_rate;

        break;

    default:

        break;

    }

}

static void compute_frame_duration(int *pnum, int *pden, AVStream *st,

                                   AVCodecParserContext *pc, AVPacket *pkt)

{

    int frame_size;



    *pnum = 0;

    *pden = 0;

    switch(st->codec->codec_type) {

    case AVMEDIA_TYPE_VIDEO:

        if (st->r_frame_rate.num) {

            *pnum = st->r_frame_rate.den;

            *pden = st->r_frame_rate.num;

        } else if(st->time_base.num*1000LL > st->time_base.den) {

            *pnum = st->time_base.num;

            *pden = st->time_base.den;

        }else if(st->codec->time_base.num*1000LL > st->codec->time_base.den){

            *pnum = st->codec->time_base.num;

            *pden = st->codec->time_base.den;

            if (pc && pc->repeat_pict) {

                *pnum = (*pnum) * (1 + pc->repeat_pict);

            }

            

            

            if(st->codec->ticks_per_frame>1 && !pc){

                *pnum = *pden = 0;

            }

        }

        break;

    case AVMEDIA_TYPE_AUDIO:

        frame_size = get_audio_frame_size(st->codec, pkt->size, 0);

        if (frame_size <= 0 || st->codec->sample_rate <= 0)

            break;

        *pnum = frame_size;

        *pden = st->codec->sample_rate;

        break;

    default:

        break;

    }

}

        if (st->r_frame_rate.num) {             *pnum = st->r_frame_rate.den;             *pden = st->r_frame_rate.num;
static void FUNC_0(int *VAR_0, int *VAR_1, AVStream *VAR_2,

                                   AVCodecParserContext *VAR_3, AVPacket *VAR_4)

{

    int VAR_5;



    *VAR_0 = 0;

    *VAR_1 = 0;

    switch(VAR_2->codec->codec_type) {

    case AVMEDIA_TYPE_VIDEO:

        if (VAR_2->r_frame_rate.num) {

            *VAR_0 = VAR_2->r_frame_rate.den;

            *VAR_1 = VAR_2->r_frame_rate.num;

        } else if(VAR_2->time_base.num*1000LL > VAR_2->time_base.den) {

            *VAR_0 = VAR_2->time_base.num;

            *VAR_1 = VAR_2->time_base.den;

        }else if(VAR_2->codec->time_base.num*1000LL > VAR_2->codec->time_base.den){

            *VAR_0 = VAR_2->codec->time_base.num;

            *VAR_1 = VAR_2->codec->time_base.den;

            if (VAR_3 && VAR_3->repeat_pict) {

                *VAR_0 = (*VAR_0) * (1 + VAR_3->repeat_pict);

            }

            

            

            if(VAR_2->codec->ticks_per_frame>1 && !VAR_3){

                *VAR_0 = *VAR_1 = 0;

            }

        }

        break;

    case AVMEDIA_TYPE_AUDIO:

        VAR_5 = get_audio_frame_size(VAR_2->codec, VAR_4->size, 0);

        if (VAR_5 <= 0 || VAR_2->codec->sample_rate <= 0)

            break;

        *VAR_0 = VAR_5;

        *VAR_1 = VAR_2->codec->sample_rate;

        break;

    default:

        break;

    }

}

static void FUNC_0(int *VAR_0, int *VAR_1, AVStream *VAR_2,
AVCodecParserContext *VAR_3, AVPacket *VAR_4)
{ int VAR_5; *VAR_0 = 0; *VAR_1 = 0; switch(VAR_2->codec->codec_type) { case AVMEDIA_TYPE_VIDEO:
if (VAR_2->r_frame_rate.num) { *VAR_0 = VAR_2->r_frame_rate.den; *VAR_1 = VAR_2->r_frame_rate.num; } else if(VAR_2->time_base.num*1000LL > VAR_2->time_base.den) { *VAR_0 = VAR_2->time_base.num; *VAR_1 = VAR_2->time_base.den; }else if(VAR_2->codec->time_base.num*1000LL > VAR_2->codec->time_base.den){ *VAR_0 = VAR_2->codec->time_base.num; *VAR_1 = VAR_2->codec->time_base.den; if (VAR_3 && VAR_3->repeat_pict) { *VAR_0 = (*VAR_0) * (1 + VAR_3->repeat_pict); } if(VAR_2->codec->ticks_per_frame>1 && !VAR_3){ *VAR_0 = *VAR_1 = 0; } } break; case AVMEDIA_TYPE_AUDIO:
VAR_5 = get_audio_frame_size(VAR_2->codec, VAR_4->size, 0); if (VAR_5 <= 0 || VAR_2->codec->sample_rate <= 0)
break; *VAR_0 = VAR_5; *VAR_1 = VAR_2->codec->sample_rate; break; default:
break; } }