Ticket #509: mythtv_badfps.patch

File mythtv_badfps.patch, 1.2 KB (added by Mark Spieth <mspieth@…>, 19 years ago)
  • libs/libavcodec/h263.c

     
    55605560    if (get_bits1(gb) != 0) {   /* fixed_vop_rate  */
    55615561        s->avctx->time_base.num = get_bits(gb, s->time_increment_bits);
    55625562    }else
    5563         s->avctx->time_base.num = 1;
     5563        s->avctx->time_base.num = s->avctx->time_base.den>10000?1001:1;
    55645564
    55655565    s->t_frame=0;
    55665566
  • libs/libmythtv/avformatdecoder.cpp

     
    680709    fps = 1 / av_q2d(enc->time_base);
    681710    // Some formats report fps waaay too high. (wrong time_base)
    682711    if (fps > 100)
    683         fps /= 100;
     712    {
     713        if (enc->time_base.den > 10000 && enc->time_base.num==1)
     714        {
     715            enc->time_base.num = 1001;  // seems pretty standard
     716            fps = 1 / av_q2d(enc->time_base);
     717        }
     718        while (fps > 100)
     719            fps /= 10;  // just for fun so its in range
     720    }
    684721
    685722    float aspect_ratio;
    686723    if (enc->sample_aspect_ratio.num == 0)