Commit 28bf7b47 authored by Gildas Bazin's avatar Gildas Bazin

* demux/dvdnav.c, access/dvdnav.c: moved dvdnav.c in the access directory.

parent 51e76e12
...@@ -4,6 +4,7 @@ SOURCES_access_udp = udp.c ...@@ -4,6 +4,7 @@ SOURCES_access_udp = udp.c
SOURCES_access_tcp = tcp.c SOURCES_access_tcp = tcp.c
SOURCES_access_http = http.c SOURCES_access_http = http.c
SOURCES_access_ftp = ftp.c SOURCES_access_ftp = ftp.c
SOURCES_dvdnav = dvdnav.c
SOURCES_dvdread = dvdread.c SOURCES_dvdread = dvdread.c
SOURCES_slp = slp.c SOURCES_slp = slp.c
SOURCES_cdda = \ SOURCES_cdda = \
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include <dvdnav/dvdnav.h> #include <dvdnav/dvdnav.h>
#include "ps.h" #include "../demux/ps.h"
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
...@@ -135,27 +135,32 @@ static int Open( vlc_object_t *p_this ) ...@@ -135,27 +135,32 @@ static int Open( vlc_object_t *p_this )
{ {
demux_t *p_demux = (demux_t*)p_this; demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys; demux_sys_t *p_sys;
dvdnav_t *p_dvdnav;
int i_title, i_chapter, i_angle; int i_title, i_chapter, i_angle;
char *psz_name; 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; return VLC_EGENERIC;
} }
psz_name = ParseCL( VLC_OBJECT(p_demux), p_demux->psz_path, VLC_TRUE, /* Open dvdnav */
&i_title, &i_chapter, &i_angle ); if( dvdnav_open( &p_dvdnav, psz_name ) != DVDNAV_STATUS_OK )
if( !psz_name )
{ {
msg_Warn( p_demux, "cannot open dvdnav" );
free( psz_name );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
free( psz_name );
/* fill p_demux field */ /* Fill p_demux field */
p_demux->pf_demux = Demux; p_demux->pf_demux = Demux;
p_demux->pf_control = Control; p_demux->pf_control = Control;
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
memset( p_sys, 0, sizeof( demux_sys_t ) ); memset( p_sys, 0, sizeof( demux_sys_t ) );
p_sys->dvdnav = p_dvdnav;
p_sys->b_simple = p_sys->b_simple =
strcmp( p_demux->psz_access, "dvdnavsimple" ) ? VLC_FALSE : VLC_TRUE; strcmp( p_demux->psz_access, "dvdnavsimple" ) ? VLC_FALSE : VLC_TRUE;
...@@ -169,15 +174,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -169,15 +174,6 @@ static int Open( vlc_object_t *p_this )
p_sys->i_aspect = -1; p_sys->i_aspect = -1;
p_sys->b_es_out_ok = VLC_FALSE; 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 ) if( 1 )
{ {
// Hack for libdvdnav CVS. // Hack for libdvdnav CVS.
...@@ -208,9 +204,9 @@ static int Open( vlc_object_t *p_this ) ...@@ -208,9 +204,9 @@ static int Open( vlc_object_t *p_this )
msg_Warn( p_demux, "cannot set PGC positioning flag" ); msg_Warn( p_demux, "cannot set PGC positioning flag" );
} }
if( dvdnav_menu_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_audio_language_select(p_sys->dvdnav,"en") != DVDNAV_STATUS_OK ||
dvdnav_spu_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)", msg_Warn( p_demux, "something failed while setting en language (%s)",
dvdnav_err_to_string( p_sys->dvdnav ) ); dvdnav_err_to_string( p_sys->dvdnav ) );
...@@ -442,7 +438,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -442,7 +438,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return VLC_EGENERIC; return VLC_EGENERIC;
} }
else if( dvdnav_part_play( p_sys->dvdnav, p_demux->info.i_title, 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" ); msg_Warn( p_demux, "cannot set title/chapter" );
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -636,11 +632,11 @@ static int Demux( demux_t *p_demux ) ...@@ -636,11 +632,11 @@ static int Demux( demux_t *p_demux )
&i_part ) == DVDNAV_STATUS_OK ) &i_part ) == DVDNAV_STATUS_OK )
{ {
if( i_title >= 0 && i_title < p_sys->i_title && if( i_title >= 0 && i_title < p_sys->i_title &&
i_part >= 0 && i_part < p_sys->title[i_title]->i_seekpoint && i_part >= 1 && i_part <= p_sys->title[i_title]->i_seekpoint &&
p_demux->info.i_seekpoint != i_part ) p_demux->info.i_seekpoint != i_part - 1 )
{ {
p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT; p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT;
p_demux->info.i_seekpoint = i_part; p_demux->info.i_seekpoint = i_part - 1;
} }
} }
break; break;
...@@ -819,7 +815,7 @@ static void DemuxTitles( demux_t *p_demux ) ...@@ -819,7 +815,7 @@ static void DemuxTitles( demux_t *p_demux )
/* Find out number of titles/chapters */ /* Find out number of titles/chapters */
dvdnav_get_number_of_titles( p_sys->dvdnav, &i_titles ); 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; int32_t i_chapters = 0;
int j; int j;
......
...@@ -15,7 +15,6 @@ SOURCES_nsv = nsv.c ...@@ -15,7 +15,6 @@ SOURCES_nsv = nsv.c
SOURCES_real = real.c SOURCES_real = real.c
SOURCES_ts = ts.c ../mux/mpeg/csa.c SOURCES_ts = ts.c ../mux/mpeg/csa.c
SOURCES_ps = ps.c ps.h SOURCES_ps = ps.c ps.h
SOURCES_dvdnav = dvdnav.c
SOURCES_mod = mod.c SOURCES_mod = mod.c
SOURCES_pva = pva.c SOURCES_pva = pva.c
SOURCES_aiff = aiff.c SOURCES_aiff = aiff.c
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment