]> git.sesse.net Git - vlc/commitdiff
* demux/dvdnav.c, access/dvdnav.c: moved dvdnav.c in the access directory.
authorGildas Bazin <gbazin@videolan.org>
Fri, 25 Jun 2004 00:16:48 +0000 (00:16 +0000)
committerGildas Bazin <gbazin@videolan.org>
Fri, 25 Jun 2004 00:16:48 +0000 (00:16 +0000)
modules/access/Modules.am
modules/access/dvdnav.c [moved from modules/demux/dvdnav.c with 98% similarity]
modules/demux/Modules.am

index 698415b2bb0a65d1758db41c2ef32a1de61c01b1..8b573da7a5e84605387e961db35ac1a86d936981 100644 (file)
@@ -4,6 +4,7 @@ SOURCES_access_udp = udp.c
 SOURCES_access_tcp = tcp.c
 SOURCES_access_http = http.c
 SOURCES_access_ftp = ftp.c
+SOURCES_dvdnav = dvdnav.c
 SOURCES_dvdread = dvdread.c
 SOURCES_slp = slp.c
 SOURCES_cdda = \
similarity index 98%
rename from modules/demux/dvdnav.c
rename to modules/access/dvdnav.c
index b4135a7cb5b83f8f434e76ad2ae16e122242f8f8..5152f629c734ac42ade384b2961d271bf2059a41 100644 (file)
@@ -34,7 +34,7 @@
 
 #include <dvdnav/dvdnav.h>
 
-#include "ps.h"
+#include "../demux/ps.h"
 
 /*****************************************************************************
  * Module descriptor
@@ -135,27 +135,32 @@ static int Open( vlc_object_t *p_this )
 {
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
+    dvdnav_t    *p_dvdnav;
     int         i_title, i_chapter, i_angle;
     char        *psz_name;
 
-    if( strncmp( p_demux->psz_access, "dvdnav", 6 ) )
+    psz_name = ParseCL( VLC_OBJECT(p_demux), p_demux->psz_path, VLC_TRUE,
+                        &i_title, &i_chapter, &i_angle );
+    if( !psz_name )
     {
-        msg_Warn( p_demux, "dvdnav module discarded" );
         return VLC_EGENERIC;
     }
 
-    psz_name = ParseCL( VLC_OBJECT(p_demux), p_demux->psz_path, VLC_TRUE,
-                        &i_title, &i_chapter, &i_angle );
-    if( !psz_name )
+    /* Open dvdnav */
+    if( dvdnav_open( &p_dvdnav, psz_name ) != DVDNAV_STATUS_OK )
     {
+        msg_Warn( p_demux, "cannot open dvdnav" );
+        free( psz_name );
         return VLC_EGENERIC;
     }
+    free( psz_name );
 
-    /* fill p_demux field */
+    /* Fill p_demux field */
     p_demux->pf_demux = Demux;
     p_demux->pf_control = Control;
     p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
     memset( p_sys, 0, sizeof( demux_sys_t ) );
+    p_sys->dvdnav = p_dvdnav;
 
     p_sys->b_simple =
         strcmp( p_demux->psz_access, "dvdnavsimple" ) ? VLC_FALSE : VLC_TRUE;
@@ -169,15 +174,6 @@ static int Open( vlc_object_t *p_this )
     p_sys->i_aspect = -1;
     p_sys->b_es_out_ok = VLC_FALSE;
 
-    /* Open dvdnav */
-    if( dvdnav_open( &p_sys->dvdnav, psz_name ) != DVDNAV_STATUS_OK )
-    {
-        msg_Warn( p_demux, "cannot open dvdnav" );
-        free( psz_name );
-        return VLC_EGENERIC;
-    }
-    free( psz_name );
-
     if( 1 )
     {
         // Hack for libdvdnav CVS.
@@ -208,9 +204,9 @@ static int Open( vlc_object_t *p_this )
         msg_Warn( p_demux, "cannot set PGC positioning flag" );
     }
 
-    if( dvdnav_menu_language_select ( p_sys->dvdnav,"en") != DVDNAV_STATUS_OK||
-        dvdnav_audio_language_select( p_sys->dvdnav,"en") != DVDNAV_STATUS_OK||
-        dvdnav_spu_language_select  ( p_sys->dvdnav,"en") != DVDNAV_STATUS_OK )
+    if( dvdnav_menu_language_select (p_sys->dvdnav,"en") != DVDNAV_STATUS_OK ||
+        dvdnav_audio_language_select(p_sys->dvdnav,"en") != DVDNAV_STATUS_OK ||
+        dvdnav_spu_language_select  (p_sys->dvdnav,"en") != DVDNAV_STATUS_OK )
     {
         msg_Warn( p_demux, "something failed while setting en language (%s)",
                   dvdnav_err_to_string( p_sys->dvdnav ) );
@@ -442,7 +438,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                     return VLC_EGENERIC;
             }
             else if( dvdnav_part_play( p_sys->dvdnav, p_demux->info.i_title,
-                                       i ) != DVDNAV_STATUS_OK )
+                                       i + 1 ) != DVDNAV_STATUS_OK )
             {
                 msg_Warn( p_demux, "cannot set title/chapter" );
                 return VLC_EGENERIC;
@@ -636,11 +632,11 @@ static int Demux( demux_t *p_demux )
                                        &i_part ) == DVDNAV_STATUS_OK )
         {
             if( i_title >= 0 && i_title < p_sys->i_title &&
-                i_part >= 0  && i_part  < p_sys->title[i_title]->i_seekpoint &&
-                p_demux->info.i_seekpoint != i_part )
+                i_part >= 1 && i_part <= p_sys->title[i_title]->i_seekpoint &&
+                p_demux->info.i_seekpoint != i_part - 1 )
             {
                 p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT;
-                p_demux->info.i_seekpoint = i_part;
+                p_demux->info.i_seekpoint = i_part - 1;
             }
         }
         break;
@@ -819,7 +815,7 @@ static void DemuxTitles( demux_t *p_demux )
 
     /* Find out number of titles/chapters */
     dvdnav_get_number_of_titles( p_sys->dvdnav, &i_titles );
-    for( i = 1; i < i_titles; i++ )
+    for( i = 1; i <= i_titles; i++ )
     {
         int32_t i_chapters = 0;
         int j;
index b209a80ac57b8c3ea81f5c457ba529c6328cfba2..fa7c8039692d2a369b536fb5878fc0949189d59b 100644 (file)
@@ -15,7 +15,6 @@ SOURCES_nsv = nsv.c
 SOURCES_real = real.c
 SOURCES_ts = ts.c ../mux/mpeg/csa.c
 SOURCES_ps = ps.c ps.h
-SOURCES_dvdnav = dvdnav.c
 SOURCES_mod = mod.c
 SOURCES_pva = pva.c
 SOURCES_aiff = aiff.c