[MPlayer-cvslog] r36529 - in trunk/stream: stream_vcd.c vcd_read.h vcd_read_darwin.h vcd_read_fbsd.h vcd_read_os2.h vcd_read_win32.h

ib subversion at mplayerhq.hu
Mon Dec 2 14:53:04 CET 2013


Author: ib
Date: Mon Dec  2 14:53:03 2013
New Revision: 36529

Log:
Revise and fix stream control for VCD.

A VCD's stream->priv is a pointer of type mp_vcd_priv_t and not one
of type stream_priv_s. Add a struct member 'track' to mp_vcd_priv_t
to store the track information there.

Modified:
   trunk/stream/stream_vcd.c
   trunk/stream/vcd_read.h
   trunk/stream/vcd_read_darwin.h
   trunk/stream/vcd_read_fbsd.h
   trunk/stream/vcd_read_os2.h
   trunk/stream/vcd_read_win32.h

Modified: trunk/stream/stream_vcd.c
==============================================================================
--- trunk/stream/stream_vcd.c	Sun Dec  1 05:17:02 2013	(r36528)
+++ trunk/stream/stream_vcd.c	Mon Dec  2 14:53:03 2013	(r36529)
@@ -90,14 +90,13 @@ static int seek(stream_t *s, int64_t new
 }
 
 static int control(stream_t *stream, int cmd, void *arg) {
-  struct stream_priv_s *p = stream->priv;
+  mp_vcd_priv_t *vcd = stream->priv;
   switch(cmd) {
     case STREAM_CTRL_GET_NUM_TITLES:
     case STREAM_CTRL_GET_NUM_CHAPTERS:
     {
-      mp_vcd_priv_t *vcd = vcd_read_toc(stream->fd);
       if (!vcd)
-        break;
+        return STREAM_ERROR;
       *(unsigned int *)arg = vcd_end_track(vcd);
       return STREAM_OK;
     }
@@ -105,19 +104,18 @@ static int control(stream_t *stream, int
     {
       int r;
       unsigned int track = *(unsigned int *)arg + 1;
-      mp_vcd_priv_t *vcd = vcd_read_toc(stream->fd);
       if (!vcd)
-        break;
+        return STREAM_ERROR;
       r = vcd_seek_to_track(vcd, track);
       if (r >= 0) {
-        p->track = track;
+        vcd->track = track;
         return STREAM_OK;
       }
       break;
     }
     case STREAM_CTRL_GET_CURRENT_CHAPTER:
     {
-      *(unsigned int *)arg = p->track - 1;
+      *(unsigned int *)arg = vcd->track - 1;
       return STREAM_OK;
     }
   }
@@ -227,6 +225,8 @@ static int open_s(stream_t *stream,int m
   }
 #endif
 
+  vcd->track = p->track;
+
   stream->fd = f;
   stream->type = STREAMTYPE_VCD;
   stream->sector_size = VCD_SECTOR_DATA;

Modified: trunk/stream/vcd_read.h
==============================================================================
--- trunk/stream/vcd_read.h	Sun Dec  1 05:17:02 2013	(r36528)
+++ trunk/stream/vcd_read.h	Mon Dec  2 14:53:03 2013	(r36529)
@@ -44,6 +44,7 @@ struct mp_vcd_priv_st {
   struct cdrom_tocentry entry;
   char buf[VCD_SECTOR_SIZE];
   struct cdrom_tochdr tochdr;
+  unsigned int track;
 };
 
 static inline void vcd_set_msf(mp_vcd_priv_t* vcd, unsigned int sect){

Modified: trunk/stream/vcd_read_darwin.h
==============================================================================
--- trunk/stream/vcd_read_darwin.h	Sun Dec  1 05:17:02 2013	(r36528)
+++ trunk/stream/vcd_read_darwin.h	Mon Dec  2 14:53:03 2013	(r36529)
@@ -55,6 +55,7 @@ typedef struct mp_vcd_priv_st
 	dk_cd_read_track_info_t entry;
 	struct CDDiscInfo hdr;
 	CDMSF msf;
+	unsigned int track;
 } mp_vcd_priv_t;
 
 static inline void vcd_set_msf(mp_vcd_priv_t* vcd, unsigned int sect)

Modified: trunk/stream/vcd_read_fbsd.h
==============================================================================
--- trunk/stream/vcd_read_fbsd.h	Sun Dec  1 05:17:02 2013	(r36528)
+++ trunk/stream/vcd_read_fbsd.h	Mon Dec  2 14:53:03 2013	(r36529)
@@ -67,6 +67,7 @@ typedef struct mp_vcd_priv_st {
   cdsector_t buf;
 #endif
   struct ioc_toc_header tochdr;
+  unsigned int track;
 } mp_vcd_priv_t;
 
 static inline void

Modified: trunk/stream/vcd_read_os2.h
==============================================================================
--- trunk/stream/vcd_read_os2.h	Sun Dec  1 05:17:02 2013	(r36528)
+++ trunk/stream/vcd_read_os2.h	Mon Dec  2 14:53:03 2013	(r36529)
@@ -39,6 +39,7 @@ typedef struct {
     int        iLastTrack;
     struct msf msfLeadOut;
     BYTE       abVCDSector[VCD_SECTOR_SIZE];
+    unsigned int track;
 } mp_vcd_priv_t;
 
 static inline void vcd_set_msf(mp_vcd_priv_t *vcd, unsigned sect)

Modified: trunk/stream/vcd_read_win32.h
==============================================================================
--- trunk/stream/vcd_read_win32.h	Sun Dec  1 05:17:02 2013	(r36528)
+++ trunk/stream/vcd_read_win32.h	Mon Dec  2 14:53:03 2013	(r36529)
@@ -38,6 +38,7 @@ struct mp_vcd_priv_st {
     CDROM_TOC toc;
     unsigned sect;
     char buf[VCD_SECTOR_SIZE];
+    unsigned int track;
 };
 
 static inline void vcd_set_msf(mp_vcd_priv_t* vcd, unsigned sect)


More information about the MPlayer-cvslog mailing list