comparison mpegvideo.c @ 1831:cd2d7fcfab7a libavcodec

use AVFrame.pts=AV_NOPTS_VALUE instead of AVFrame.pts=0 move AV_NOPTS_VALUE & AV_TIME_BASE from avformat.h -> avcodec.h related fixes
author michael
date Wed, 25 Feb 2004 17:35:52 +0000
parents 7ae26b6e197f
children ba27ce284d07
comparison
equal deleted inserted replaced
1830:024752284c25 1831:cd2d7fcfab7a
1848 } 1848 }
1849 } 1849 }
1850 copy_picture_attributes(pic, pic_arg); 1850 copy_picture_attributes(pic, pic_arg);
1851 1851
1852 pic->display_picture_number= s->input_picture_number++; 1852 pic->display_picture_number= s->input_picture_number++;
1853 if(pic->pts){ 1853 if(pic->pts != AV_NOPTS_VALUE){
1854 s->user_specified_pts= pic->pts; 1854 s->user_specified_pts= pic->pts;
1855 }else{ 1855 }else{
1856 if(s->user_specified_pts){ 1856 if(s->user_specified_pts){
1857 pic->pts= s->user_specified_pts + 1000ULL*1000ULL*s->avctx->frame_rate_base / s->avctx->frame_rate; 1857 pic->pts= s->user_specified_pts + AV_TIME_BASE*(int64_t)s->avctx->frame_rate_base / s->avctx->frame_rate;
1858 av_log(s->avctx, AV_LOG_INFO, "Warning: AVFrame.pts=0 trying to guess (%Ld)\n", pic->pts); 1858 av_log(s->avctx, AV_LOG_INFO, "Warning: AVFrame.pts=? trying to guess (%Ld)\n", pic->pts);
1859 }else{ 1859 }else{
1860 pic->pts= av_rescale(pic->display_picture_number*(int64_t)s->avctx->frame_rate_base, 1000*1000, s->avctx->frame_rate); 1860 pic->pts= av_rescale(pic->display_picture_number*(int64_t)s->avctx->frame_rate_base, AV_TIME_BASE, s->avctx->frame_rate);
1861 } 1861 }
1862 } 1862 }
1863 } 1863 }
1864 1864
1865 /* shift buffer entries */ 1865 /* shift buffer entries */