]> git.sesse.net Git - vlc/blobdiff - modules/access/vcd/vcd.c
* Reset access->info.b_eof when we search. After you have read up untill the end...
[vlc] / modules / access / vcd / vcd.c
index 76822e43f18bb11be7ce7a892236423d4058ea8f..71299959af5b8a2210d24655dbbe159bf83a9d2f 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * vcd.c : VCD input module for vlc
  *****************************************************************************
- * Copyright (C) 2000-2004 VideoLAN
+ * Copyright (C) 2000-2004 the VideoLAN team
  * $Id$
  *
  * Author: Johan Bilien <jobi@via.ecp.fr>
@@ -18,7 +18,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -39,13 +39,16 @@ static void Close( vlc_object_t * );
 
 #define CACHING_TEXT N_("Caching value in ms")
 #define CACHING_LONGTEXT N_( \
-    "Allows you to modify the default caching value for cdda streams. This " \
-    "value should be set in milliseconds units." )
+    "Caching value for VCDs. This " \
+    "value should be set in milliseconds." )
 
 vlc_module_begin();
+    set_shortname( _("VCD"));
     set_description( _("VCD input") );
-    set_capability( "access2", 10 );
+    set_capability( "access2", 60 );
     set_callbacks( Open, Close );
+    set_category( CAT_INPUT );
+    set_subcategory( SUBCAT_INPUT_ACCESS );
 
     add_usage_hint( N_("[vcd:][device][@[title][,[chapter]]]") );
     add_integer( "vcd-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT,
@@ -121,10 +124,14 @@ static int Open( vlc_object_t *p_this )
         }
     }
 
+#ifdef WIN32
+    if( psz_dup[0] && psz_dup[1] == ':' &&
+        psz_dup[2] == '\\' && psz_dup[3] == '\0' ) psz_dup[2] = '\0';
+#endif
+
     /* Open VCD */
     if( !(vcddev = ioctl_Open( p_this, psz_dup )) )
     {
-        msg_Warn( p_access, "could not open %s", psz_dup );
         free( psz_dup );
         return VLC_EGENERIC;
     }
@@ -166,8 +173,8 @@ static int Open( vlc_object_t *p_this )
     {
         input_title_t *t = p_sys->title[i] = vlc_input_title_New();
 
-        fprintf( stderr, "title[%d] start=%d\n", i, p_sys->p_sectors[1+i] );
-        fprintf( stderr, "title[%d] end=%d\n", i, p_sys->p_sectors[i+2] );
+        msg_Dbg( p_access, "title[%d] start=%d\n", i, p_sys->p_sectors[1+i] );
+        msg_Dbg( p_access, "title[%d] end=%d\n", i, p_sys->p_sectors[i+2] );
 
         t->i_size = ( p_sys->p_sectors[i+2] - p_sys->p_sectors[i+1] ) *
                     (int64_t)VCD_DATA_SIZE;
@@ -306,8 +313,11 @@ static int Control( access_t *p_access, int i_query, va_list args )
             return VLC_SUCCESS;
         }
 
+        case ACCESS_SET_PRIVATE_ID_STATE:
+            return VLC_EGENERIC;
+
         default:
-            msg_Err( p_access, "unimplemented query in control" );
+            msg_Warn( p_access, "unimplemented query in control" );
             return VLC_EGENERIC;
 
     }
@@ -424,6 +434,9 @@ static int Seek( access_t *p_access, int64_t i_pos )
         p_access->info.i_seekpoint = i_seekpoint;
     }
 
+    /* Reset eof */
+    p_access->info.b_eof = VLC_FALSE;
+
     return VLC_SUCCESS;
 }
 
@@ -486,3 +499,4 @@ static int EntryPoints( access_t *p_access )
 
     return VLC_SUCCESS;
 }
+