comparison h261.c @ 3580:28574f57a0fc libavcodec

fix codec timebase and timestamps
author michael
date Mon, 14 Aug 2006 18:17:14 +0000
parents df07afe83a62
children faa8dc533ad3
comparison
equal deleted inserted replaced
3579:df07afe83a62 3580:28574f57a0fc
779 av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n"); 779 av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
780 return -1; 780 return -1;
781 } 781 }
782 782
783 /* temporal reference */ 783 /* temporal reference */
784 s->picture_number = get_bits(&s->gb, 5); /* picture timestamp */ 784 i= get_bits(&s->gb, 5); /* picture timestamp */
785 if(i < (s->picture_number&31))
786 i += 32;
787 s->picture_number = (s->picture_number&~31) + i;
788
789 s->avctx->time_base= (AVRational){1001, 30000};
790 s->current_picture.pts= s->picture_number;
791
785 792
786 /* PTYPE starts here */ 793 /* PTYPE starts here */
787 skip_bits1(&s->gb); /* split screen off */ 794 skip_bits1(&s->gb); /* split screen off */
788 skip_bits1(&s->gb); /* camera off */ 795 skip_bits1(&s->gb); /* camera off */
789 skip_bits1(&s->gb); /* freeze picture release off */ 796 skip_bits1(&s->gb); /* freeze picture release off */
996 assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type); 1003 assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type);
997 assert(s->current_picture.pict_type == s->pict_type); 1004 assert(s->current_picture.pict_type == s->pict_type);
998 *pict= *(AVFrame*)s->current_picture_ptr; 1005 *pict= *(AVFrame*)s->current_picture_ptr;
999 ff_print_debug_info(s, pict); 1006 ff_print_debug_info(s, pict);
1000 1007
1001 /* Return the Picture timestamp as the frame number */
1002 /* we substract 1 because it is added on utils.c */
1003 avctx->frame_number = s->picture_number - 1;
1004
1005 *data_size = sizeof(AVFrame); 1008 *data_size = sizeof(AVFrame);
1006 1009
1007 return get_consumed_bytes(s, buf_size); 1010 return get_consumed_bytes(s, buf_size);
1008 } 1011 }
1009 1012