comparison mov.c @ 85:25062c9b1f86 libavformat

per context frame_rate_base, this should finally fix frame_rate related av sync issues
author michaelni
date Wed, 12 Mar 2003 15:16:19 +0000
parents a58a8a53eb46
children 0865b0aaa2af
comparison
equal deleted inserted replaced
84:0068a6902911 85:25062c9b1f86
684 url_fskip(pb, 32); /* codec name */ 684 url_fskip(pb, 32); /* codec name */
685 685
686 get_be16(pb); /* depth */ 686 get_be16(pb); /* depth */
687 get_be16(pb); /* colortable id */ 687 get_be16(pb); /* colortable id */
688 688
689 st->codec.frame_rate = 25 * FRAME_RATE_BASE; 689 st->codec.frame_rate = 25;
690 st->codec.frame_rate_base = 1;
690 691
691 size -= (16+8*4+2+32+2*2); 692 size -= (16+8*4+2+32+2*2);
692 while (size >= 8) { 693 while (size >= 8) {
693 int atom_size, atom_type; 694 int atom_size, atom_type;
694 int64_t start_pos; 695 int64_t start_pos;
930 931
931 get_be32(pb); 932 get_be32(pb);
932 sample_duration = get_be32(pb); 933 sample_duration = get_be32(pb);
933 934
934 if (!i && st->codec.codec_type==CODEC_TYPE_VIDEO) { 935 if (!i && st->codec.codec_type==CODEC_TYPE_VIDEO) {
935 st->codec.frame_rate = FRAME_RATE_BASE * c->streams[c->total_streams]->time_scale; 936 st->codec.frame_rate_base = sample_duration ? sample_duration : 1;
936 if (sample_duration) 937 st->codec.frame_rate = c->streams[c->total_streams]->time_scale;
937 st->codec.frame_rate /= sample_duration;
938 #ifdef DEBUG 938 #ifdef DEBUG
939 printf("VIDEO FRAME RATE= %i (sd= %i)\n", st->codec.frame_rate, sample_duration); 939 printf("VIDEO FRAME RATE= %i (sd= %i)\n", st->codec.frame_rate, sample_duration);
940 #endif 940 #endif
941 } 941 }
942 } 942 }