comparison h263.c @ 1586:3d1d0490e5a6 libavcodec

pts fix and related fixes
author michael
date Thu, 30 Oct 2003 16:58:49 +0000
parents 3615999a7284
children 932d306bf1dc
comparison
equal deleted inserted replaced
1585:6b224ca24033 1586:3d1d0490e5a6
1846 1846
1847 /* must be called before writing the header */ 1847 /* must be called before writing the header */
1848 void ff_set_mpeg4_time(MpegEncContext * s, int picture_number){ 1848 void ff_set_mpeg4_time(MpegEncContext * s, int picture_number){
1849 int time_div, time_mod; 1849 int time_div, time_mod;
1850 1850
1851 if(s->current_picture.pts) 1851 if(s->current_picture_ptr->pts)
1852 s->time= (s->current_picture.pts*s->time_increment_resolution + 500*1000)/(1000*1000); 1852 s->time= (s->current_picture_ptr->pts*s->time_increment_resolution + 500*1000)/(1000*1000);
1853 else 1853 else
1854 s->time= av_rescale(picture_number*(int64_t)s->avctx->frame_rate_base, s->time_increment_resolution, s->avctx->frame_rate); 1854 s->time= av_rescale(picture_number*(int64_t)s->avctx->frame_rate_base, s->time_increment_resolution, s->avctx->frame_rate);
1855 time_div= s->time/s->time_increment_resolution; 1855 time_div= s->time/s->time_increment_resolution;
1856 time_mod= s->time%s->time_increment_resolution; 1856 time_mod= s->time%s->time_increment_resolution;
1857 1857
4992 - ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2; 4992 - ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2;
4993 s->pb_field_time= ( ROUNDED_DIV(s->time, s->t_frame) 4993 s->pb_field_time= ( ROUNDED_DIV(s->time, s->t_frame)
4994 - ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2; 4994 - ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2;
4995 } 4995 }
4996 4996
4997 s->current_picture.pts= s->time*1000LL*1000LL / s->time_increment_resolution; 4997 s->current_picture_ptr->pts= s->time*1000LL*1000LL / s->time_increment_resolution;
4998 if(s->avctx->debug&FF_DEBUG_PTS) 4998 if(s->avctx->debug&FF_DEBUG_PTS)
4999 printf("MPEG4 PTS: %f\n", s->current_picture.pts/(1000.0*1000.0)); 4999 printf("MPEG4 PTS: %f\n", s->current_picture_ptr->pts/(1000.0*1000.0));
5000 5000
5001 check_marker(gb, "before vop_coded"); 5001 check_marker(gb, "before vop_coded");
5002 5002
5003 /* vop coded */ 5003 /* vop coded */
5004 if (get_bits1(gb) != 1){ 5004 if (get_bits1(gb) != 1){