- PRINT(("%s()\n", __FUNCTION__));
-
- vtag = get_le32(pb);
- atag = get_le32(pb);
- vwidth = get_le16(pb);
- vheight = get_le16(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", i));
- if(i&0x80) framerate= nsv_framerate_table[i & 0x7F];
- else framerate= (AVRational){i, 1};
- unknown = get_le16(pb);
-#ifdef DEBUG
+ av_dlog(s, "%s()\n", __FUNCTION__);
+
+ vtag = avio_rl32(pb);
+ atag = avio_rl32(pb);
+ vwidth = avio_rl16(pb);
+ vheight = avio_rl16(pb);
+ i = avio_r8(pb);
+
+ av_dlog(s, "NSV NSVs framerate code %2x\n", i);
+ if(i&0x80) { /* odd way of giving native framerates from docs */
+ int t=(i & 0x7F)>>2;
+ if(t<16) framerate = (AVRational){1, t+1};
+ else framerate = (AVRational){t-15, 1};
+
+ if(i&1){
+ framerate.num *= 1000;
+ framerate.den *= 1001;
+ }
+
+ if((i&3)==3) framerate.num *= 24;
+ else if((i&3)==2) framerate.num *= 25;
+ else framerate.num *= 30;
+ }
+ else
+ framerate= (AVRational){i, 1};
+
+ nsv->avsync = avio_rl16(pb);
+ nsv->framerate = framerate;
+