aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avidec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-03-12 15:16:19 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-03-12 15:16:19 +0000
commit14bea432f16d7c66f9099e427819028b6b4c3bdc (patch)
treec52726ce14a0265337b9deebd2214e2552d284b0 /libavformat/avidec.c
parent586bc7553ca90dee507afd950de64bbd2c6a80b5 (diff)
downloadffmpeg-14bea432f16d7c66f9099e427819028b6b4c3bdc.tar.gz
per context frame_rate_base, this should finally fix frame_rate related av sync issues
Originally committed as revision 1666 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r--libavformat/avidec.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 6d23f07079..bec8c77040 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -133,12 +133,16 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
scale= get_le32(pb); /* scale */
rate= get_le32(pb); /* rate */
- if(scale && rate)
- st->codec.frame_rate= (rate * (uint64_t)FRAME_RATE_BASE + scale/2) / scale;
- else if(frame_period)
- st->codec.frame_rate = (1000000LL * FRAME_RATE_BASE + frame_period/2) / frame_period;
- else
- st->codec.frame_rate = 25 * FRAME_RATE_BASE;
+ if(scale && rate){
+ st->codec.frame_rate = rate;
+ st->codec.frame_rate_base= scale;
+ }else if(frame_period){
+ st->codec.frame_rate = 1000000;
+ st->codec.frame_rate_base= frame_period;
+ }else{
+ st->codec.frame_rate = 25;
+ st->codec.frame_rate_base = 1;
+ }
url_fskip(pb, size - 7 * 4);
break;