[Ffmpeg-cvslog] CVS: ffmpeg/libavformat nsvdec.c,1.5,1.6
Michael Niedermayer CVS
michael
Tue Apr 26 23:46:48 CEST 2005
- Previous message: [Ffmpeg-cvslog] CVS: ffmpeg/libavformat dv.c,1.40,1.41
- Next message: [Ffmpeg-cvslog] CVS: ffmpeg/libavcodec apiexample.c, 1.18, 1.19 avcodec.h, 1.392, 1.393 h261.c, 1.25, 1.26 h263.c, 1.276, 1.277 h264.c, 1.114, 1.115 mpeg12.c, 1.234, 1.235 mpegvideo.c, 1.476, 1.477 mpegvideo.h, 1.222, 1.223 msmpeg4.c, 1.87, 1.88 oggvorbis.c, 1.16, 1.17 parser.c, 1.23, 1.24 ratecontrol.c, 1.48, 1.49 utils.c, 1.137, 1.138 vc9.c, 1.18, 1.19 wmv2.c, 1.31, 1.32 x264.c, 1.5, 1.6 xvidff.c, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv27318
Modified Files:
nsvdec.c
Log Message:
fix useless framerate messup
Index: nsvdec.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/nsvdec.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- nsvdec.c 24 Feb 2005 19:08:50 -0000 1.5
+++ nsvdec.c 26 Apr 2005 21:46:46 -0000 1.6
@@ -205,13 +205,13 @@
{ 0, 0 },
};
-static const uint64_t nsv_framerate_table[] = {
- ((uint64_t)AV_TIME_BASE * 30),
- ((uint64_t)AV_TIME_BASE * 30000 / 1001), /* 29.97 */
- ((uint64_t)AV_TIME_BASE * 25),
- ((uint64_t)AV_TIME_BASE * 24000 / 1001), /* 23.98 */
- ((uint64_t)AV_TIME_BASE * 30), /* ?? */
- ((uint64_t)AV_TIME_BASE * 15000 / 1001), /* 14.98 */
+static const AVRational nsv_framerate_table[] = {
+ {30,1},
+ {30000,1001},
+ {25,1},
+ {24000,1001},
+ {30,1},
+ {15000,1001},
};
//static int nsv_load_index(AVFormatContext *s);
@@ -401,7 +401,8 @@
ByteIOContext *pb = &s->pb;
uint32_t vtag, atag;
uint16_t vwidth, vheight;
- uint32_t framerate;
+ AVRational framerate;
+ int i;
uint16_t unknown;
AVStream *st;
NSVStream *nst;
@@ -411,17 +412,17 @@
atag = get_le32(pb);
vwidth = get_le16(pb);
vheight = get_le16(pb);
- framerate = (uint8_t)get_byte(pb);
+ i = get_byte(pb);
/* XXX how big must the table be ? */
/* seems there is more to that... */
- PRINT(("NSV NSVs framerate code %2x\n", framerate));
- framerate = (framerate & 0x80)?(nsv_framerate_table[framerate & 0x7F]):(framerate*AV_TIME_BASE);
+ PRINT(("NSV NSVs framerate code %2x\n", i));
+ if(i&0x80) framerate= nsv_framerate_table[i & 0x7F];
+ else framerate= (AVRational){i, 1};
unknown = get_le16(pb);
#ifdef DEBUG
print_tag("NSV NSVs vtag", vtag, 0);
print_tag("NSV NSVs atag", atag, 0);
PRINT(("NSV NSVs vsize %dx%d\n", vwidth, vheight));
- PRINT(("NSV NSVs framerate %2x\n", framerate));
#endif
/* XXX change to ap != NULL ? */
@@ -446,9 +447,9 @@
st->codec.height = vheight;
st->codec.bits_per_sample = 24; /* depth XXX */
- st->codec.frame_rate = framerate;
- st->codec.frame_rate_base = AV_TIME_BASE;
- av_set_pts_info(st, 64, AV_TIME_BASE, framerate);
+ av_set_pts_info(st, 64, framerate.den, framerate.num);
+ st->codec.frame_rate = framerate.num;
+ st->codec.frame_rate_base = framerate.den;
st->start_time = 0;
st->duration = nsv->duration;
}
- Previous message: [Ffmpeg-cvslog] CVS: ffmpeg/libavformat dv.c,1.40,1.41
- Next message: [Ffmpeg-cvslog] CVS: ffmpeg/libavcodec apiexample.c, 1.18, 1.19 avcodec.h, 1.392, 1.393 h261.c, 1.25, 1.26 h263.c, 1.276, 1.277 h264.c, 1.114, 1.115 mpeg12.c, 1.234, 1.235 mpegvideo.c, 1.476, 1.477 mpegvideo.h, 1.222, 1.223 msmpeg4.c, 1.87, 1.88 oggvorbis.c, 1.16, 1.17 parser.c, 1.23, 1.24 ratecontrol.c, 1.48, 1.49 utils.c, 1.137, 1.138 vc9.c, 1.18, 1.19 wmv2.c, 1.31, 1.32 x264.c, 1.5, 1.6 xvidff.c, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the ffmpeg-cvslog
mailing list