summaryrefslogtreecommitdiff
path: root/libavcodec/h263.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-02-25 17:35:52 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-02-25 17:35:52 +0000
commit9740beffc65d08ba454ce4c1d904b6d9388a6544 (patch)
treeaac8e8724add20e3f08ab24c0bf7d15f847dd56f /libavcodec/h263.c
parent8ac5c1b2d343ef6c1c759d3fb5a32de984ff9ab5 (diff)
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 Originally committed as revision 2814 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r--libavcodec/h263.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index 2318c07774..3df42aabe9 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -2156,8 +2156,8 @@ void ff_mpeg4_stuffing(PutBitContext * pbc)
void ff_set_mpeg4_time(MpegEncContext * s, int picture_number){
int time_div, time_mod;
- assert(s->current_picture_ptr->pts);
- s->time= (s->current_picture_ptr->pts*s->time_increment_resolution + 500*1000)/(1000*1000);
+ assert(s->current_picture_ptr->pts != AV_NOPTS_VALUE);
+ s->time= (s->current_picture_ptr->pts*s->time_increment_resolution + AV_TIME_BASE/2)/AV_TIME_BASE;
time_div= s->time/s->time_increment_resolution;
time_mod= s->time%s->time_increment_resolution;
@@ -2179,11 +2179,10 @@ static void mpeg4_encode_gop_header(MpegEncContext * s){
put_bits(&s->pb, 16, 0);
put_bits(&s->pb, 16, GOP_STARTCODE);
- if(s->current_picture_ptr->pts && s->reordered_input_picture[1]){
- time= FFMIN(s->reordered_input_picture[1]->pts, s->current_picture_ptr->pts);
- time= (time*s->time_increment_resolution + 500*1000)/(1000*1000);
- }else
- time= av_rescale(s->current_picture_ptr->coded_picture_number*(int64_t)s->avctx->frame_rate_base, s->time_increment_resolution, s->avctx->frame_rate);
+ time= s->current_picture_ptr->pts;
+ if(s->reordered_input_picture[1])
+ time= FFMIN(time, s->reordered_input_picture[1]->pts);
+ time= (time*s->time_increment_resolution + AV_TIME_BASE/2)/AV_TIME_BASE;
seconds= time/s->time_increment_resolution;
minutes= seconds/60; seconds %= 60;
@@ -5709,9 +5708,9 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
- ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2;
}
- s->current_picture_ptr->pts= s->time*1000LL*1000LL / s->time_increment_resolution;
+ s->current_picture_ptr->pts= s->time*(int64_t)AV_TIME_BASE / s->time_increment_resolution;
if(s->avctx->debug&FF_DEBUG_PTS)
- av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %f\n", s->current_picture_ptr->pts/(1000.0*1000.0));
+ av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %f\n", s->current_picture_ptr->pts/(float)AV_TIME_BASE);
check_marker(gb, "before vop_coded");