Revision 2f35beae libavformat/utils.c

View differences:

libavformat/utils.c
3762 3762
void av_set_pts_info(AVStream *s, int pts_wrap_bits,
3763 3763
                     unsigned int pts_num, unsigned int pts_den)
3764 3764
{
3765
    s->pts_wrap_bits = pts_wrap_bits;
3766

  
3767
    if(av_reduce(&s->time_base.num, &s->time_base.den, pts_num, pts_den, INT_MAX)){
3768
        if(s->time_base.num != pts_num)
3769
            av_log(NULL, AV_LOG_DEBUG, "st:%d removing common factor %d from timebase\n", s->index, pts_num/s->time_base.num);
3765
    AVRational new_tb;
3766
    if(av_reduce(&new_tb.num, &new_tb.den, pts_num, pts_den, INT_MAX)){
3767
        if(new_tb.num != pts_num)
3768
            av_log(NULL, AV_LOG_DEBUG, "st:%d removing common factor %d from timebase\n", s->index, pts_num/new_tb.num);
3770 3769
    }else
3771 3770
        av_log(NULL, AV_LOG_WARNING, "st:%d has too large timebase, reducing\n", s->index);
3772 3771

  
3773
    if(!s->time_base.num || !s->time_base.den)
3774
        s->time_base.num= s->time_base.den= 0;
3772
    if(new_tb.num <= 0 || new_tb.den <= 0) {
3773
        av_log(NULL, AV_LOG_ERROR, "Ignoring attempt to set invalid timebase for st:%d\n", s->index);
3774
        return;
3775
    }
3776
    s->time_base = new_tb;
3777
    s->pts_wrap_bits = pts_wrap_bits;
3775 3778
}
3776 3779

  
3777 3780
int ff_url_join(char *str, int size, const char *proto,

Also available in: Unified diff