summaryrefslogtreecommitdiffstats
path: root/stream/vcd_read_fbsd.h
diff options
context:
space:
mode:
Diffstat (limited to 'stream/vcd_read_fbsd.h')
-rw-r--r--stream/vcd_read_fbsd.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/stream/vcd_read_fbsd.h b/stream/vcd_read_fbsd.h
index f0a6022384..22aa198086 100644
--- a/stream/vcd_read_fbsd.h
+++ b/stream/vcd_read_fbsd.h
@@ -29,6 +29,20 @@ vcd_set_msf(mp_vcd_priv_t* vcd, unsigned int sect)
TOCADDR(vcd->entry).msf.minute = sect;
}
+static inline void
+vcd_inc_msf(mp_vcd_priv_t* vcd)
+{
+ TOCADDR(vcd->entry).msf.frame++;
+ if (TOCADDR(vcd->entry).msf.frame==75){
+ TOCADDR(vcd->entry).msf.frame=0;
+ TOCADDR(vcd->entry).msf.second++;
+ if (TOCADDR(vcd->entry).msf.second==60){
+ TOCADDR(vcd->entry).msf.second=0;
+ TOCADDR(vcd->entry).msf.minute++;
+ }
+ }
+}
+
static inline unsigned int
vcd_get_msf(mp_vcd_priv_t* vcd)
{
@@ -136,15 +150,7 @@ vcd_read(mp_vcd_priv_t* vcd, char *mem)
if (pread(vcd->fd,&vcd->buf,VCD_SECTOR_SIZE,vcd_get_msf(vcd)*VCD_SECTOR_SIZE)
!= VCD_SECTOR_SIZE) return 0; // EOF?
- TOCADDR(vcd->entry).msf.frame++;
- if (TOCADDR(vcd->entry).msf.frame==75){
- TOCADDR(vcd->entry).msf.frame=0;
- TOCADDR(vcd->entry).msf.second++;
- if (TOCADDR(vcd->entry).msf.second==60){
- TOCADDR(vcd->entry).msf.second=0;
- TOCADDR(vcd->entry).msf.minute++;
- }
- }
+ vcd_inc_msf(vcd);
memcpy(mem,vcd->buf.data,VCD_SECTOR_DATA);
return VCD_SECTOR_DATA;
}