1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-30 23:38:10 +00:00

Make compilation depending on USE_SUB unconditional.

USE_SUB was hardcoded to true in configure, manually turning it off
would break compilation, and there's no apparent reason why having all
subtitle code under #ifdefs (even working ones) would be worth the
clutter.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21156 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
uau 2006-11-21 20:48:17 +00:00
parent 033fc8c6dd
commit 2b50b7ddab
11 changed files with 3 additions and 104 deletions

View File

@ -380,9 +380,7 @@ void guiInit( void )
if ( filename ) mplSetFileName( NULL,filename,STREAMTYPE_FILE ); if ( filename ) mplSetFileName( NULL,filename,STREAMTYPE_FILE );
if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE ); if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE );
if ( subdata ) guiSetFilename( guiIntfStruct.Subtitlename, subdata->filename ); if ( subdata ) guiSetFilename( guiIntfStruct.Subtitlename, subdata->filename );
#if defined( USE_OSD ) || defined( USE_SUB )
guiLoadFont(); guiLoadFont();
#endif
} }
void guiDone( void ) void guiDone( void )
@ -427,7 +425,6 @@ extern int stream_dump_type;
extern int vcd_track; extern int vcd_track;
extern m_obj_settings_t*vo_plugin_args; extern m_obj_settings_t*vo_plugin_args;
#if defined( USE_OSD ) || defined( USE_SUB )
void guiLoadFont( void ) void guiLoadFont( void )
{ {
#ifdef HAVE_FREETYPE #ifdef HAVE_FREETYPE
@ -469,9 +466,7 @@ void guiLoadFont( void )
} }
#endif #endif
} }
#endif
#ifdef USE_SUB
extern mp_osd_obj_t* vo_osd_list; extern mp_osd_obj_t* vo_osd_list;
extern char **sub_name; extern char **sub_name;
@ -518,7 +513,6 @@ void guiLoadSubtitle( char * name )
update_set_of_subtitles(); update_set_of_subtitles();
} }
#endif
static void add_vop( char * str ) static void add_vop( char * str )
{ {
@ -905,16 +899,12 @@ int guiGetEvent( int type,char * arg )
} }
#endif #endif
// -- subtitle // -- subtitle
#ifdef USE_SUB
//subdata->filename=gstrdup( guiIntfStruct.Subtitlename ); //subdata->filename=gstrdup( guiIntfStruct.Subtitlename );
stream_dump_type=0; stream_dump_type=0;
if ( gtkSubDumpMPSub ) stream_dump_type=4; if ( gtkSubDumpMPSub ) stream_dump_type=4;
if ( gtkSubDumpSrt ) stream_dump_type=6; if ( gtkSubDumpSrt ) stream_dump_type=6;
gtkSubDumpMPSub=gtkSubDumpSrt=0; gtkSubDumpMPSub=gtkSubDumpSrt=0;
#endif
#if defined( USE_OSD ) || defined( USE_SUB )
guiLoadFont(); guiLoadFont();
#endif
// --- misc // --- misc
if ( gtkCacheOn ) stream_cache_size=gtkCacheSize; if ( gtkCacheOn ) stream_cache_size=gtkCacheSize;

View File

@ -496,12 +496,10 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
gfree( (void **)&guiIntfStruct.Subtitlename ); gfree( (void **)&guiIntfStruct.Subtitlename );
fs_PersistantHistory( fsSelectedDirectory ); //totem, write into history fs_PersistantHistory( fsSelectedDirectory ); //totem, write into history
break; break;
#ifdef USE_SUB
case fsSubtitleSelector: case fsSubtitleSelector:
guiSetDF( guiIntfStruct.Subtitlename,fsSelectedDirectory,fsSelectedFile ); guiSetDF( guiIntfStruct.Subtitlename,fsSelectedDirectory,fsSelectedFile );
guiLoadSubtitle( guiIntfStruct.Subtitlename ); guiLoadSubtitle( guiIntfStruct.Subtitlename );
break; break;
#endif
case fsOtherSelector: case fsOtherSelector:
guiSetDF( guiIntfStruct.Othername,fsSelectedDirectory,fsSelectedFile ); guiSetDF( guiIntfStruct.Othername,fsSelectedDirectory,fsSelectedFile );
break; break;
@ -510,9 +508,7 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
break; break;
case fsFontSelector: case fsFontSelector:
guiSetDF( font_name,fsSelectedDirectory,fsSelectedFile ); guiSetDF( font_name,fsSelectedDirectory,fsSelectedFile );
#if defined( USE_OSD ) || defined( USE_SUB )
guiLoadFont(); guiLoadFont();
#endif
if ( Preferences ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name ); if ( Preferences ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name );
break; break;
} }

View File

@ -400,18 +400,6 @@ void ShowPreferences( void )
else gtk_entry_set_text( GTK_ENTRY( prECDRomDevice ),DEFAULT_CDROM_DEVICE ); else gtk_entry_set_text( GTK_ENTRY( prECDRomDevice ),DEFAULT_CDROM_DEVICE );
// -- disables // -- disables
#ifndef USE_SUB
gtk_widget_set_sensitive( AConfig,FALSE );
gtk_widget_set_sensitive( CBNoAutoSub,FALSE );
gtk_widget_set_sensitive( CBSubOverlap,FALSE );
gtk_widget_set_sensitive( CBSubUnicode,FALSE );
gtk_widget_set_sensitive( CBDumpMPSub,FALSE );
gtk_widget_set_sensitive( CBDumpSrt,FALSE );
gtk_widget_set_sensitive( HSSubDelay,FALSE );
gtk_widget_set_sensitive( HSSubPosition,FALSE );
gtk_widget_set_sensitive( HSSubFPS,FALSE );
#endif
#ifndef USE_ASS #ifndef USE_ASS
gtk_widget_set_sensitive( CBUseASS,FALSE ); gtk_widget_set_sensitive( CBUseASS,FALSE );
gtk_widget_set_sensitive( CBASSUseMargins,FALSE ); gtk_widget_set_sensitive( CBASSUseMargins,FALSE );
@ -426,12 +414,6 @@ void ShowPreferences( void )
gtk_widget_set_sensitive( RBOSDTPTT,FALSE ); gtk_widget_set_sensitive( RBOSDTPTT,FALSE );
#endif #endif
#if !defined( USE_OSD ) && !defined( USE_SUB )
gtk_widget_set_sensitive( HSFontFactor,FALSE );
gtk_widget_set_sensitive( prEFontName,FALSE );
gtk_widget_set_sensitive( BLoadFont,FALSE );
#endif
// -- signals // -- signals
gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)0 ); gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)0 );
gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 ); gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 );

View File

@ -43,7 +43,6 @@ extern int get_video_colors(sh_video_t *sh_video, char *item, int *value);
guiInterface_t guiIntfStruct; guiInterface_t guiIntfStruct;
int addurl = 0; int addurl = 0;
#ifdef USE_SUB
extern mp_osd_obj_t* vo_osd_list; extern mp_osd_obj_t* vo_osd_list;
extern char **sub_name; extern char **sub_name;
@ -89,7 +88,6 @@ void guiLoadSubtitle(char *name)
} }
update_set_of_subtitles(); update_set_of_subtitles();
} }
#endif
int display_openfilewindow(gui_t *gui, int add) int display_openfilewindow(gui_t *gui, int add)
{ {
@ -156,7 +154,6 @@ int display_openfilewindow(gui_t *gui, int add)
return result; return result;
} }
#ifdef USE_SUB
void display_opensubtitlewindow(gui_t *gui) void display_opensubtitlewindow(gui_t *gui)
{ {
OPENFILENAME subtitleopen; OPENFILENAME subtitleopen;
@ -183,7 +180,6 @@ void display_opensubtitlewindow(gui_t *gui)
if(GetOpenFileName(&subtitleopen)) if(GetOpenFileName(&subtitleopen))
guiLoadSubtitle(subtitlefile); guiLoadSubtitle(subtitlefile);
} }
#endif
void display_loadplaylistwindow(gui_t *gui) void display_loadplaylistwindow(gui_t *gui)
{ {

View File

@ -216,11 +216,9 @@ static void handlemsg(HWND hWnd, int msg)
if(display_openfilewindow(gui, 0) && (msg == evLoadPlay)) if(display_openfilewindow(gui, 0) && (msg == evLoadPlay))
handlemsg(hWnd, evDropFile); handlemsg(hWnd, evDropFile);
return; return;
#ifdef USE_SUB
case evLoadSubtitle: case evLoadSubtitle:
display_opensubtitlewindow(gui); display_opensubtitlewindow(gui);
break; break;
#endif
case evPreferences: case evPreferences:
display_prefswindow(gui); display_prefswindow(gui);
return; return;
@ -979,11 +977,9 @@ static LRESULT CALLBACK EventProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
case ID_MUTE: case ID_MUTE:
mp_input_queue_cmd(mp_input_parse_cmd("mute")); mp_input_queue_cmd(mp_input_parse_cmd("mute"));
break; break;
#ifdef USE_SUB
case IDSUBTITLE_OPEN: case IDSUBTITLE_OPEN:
display_opensubtitlewindow(gui); display_opensubtitlewindow(gui);
break; break;
#endif
case ID_PTRACK: case ID_PTRACK:
handlemsg(hWnd, evPrev); handlemsg(hWnd, evPrev);
break; break;
@ -1186,9 +1182,7 @@ static void create_menu(gui_t *gui)
AppendMenu(gui->menu, MF_SEPARATOR, 0, 0); AppendMenu(gui->menu, MF_SEPARATOR, 0, 0);
AppendMenu(gui->menu, MF_STRING | MF_POPUP, (UINT) gui->diskmenu, "Play &CD/DVD/VCD/SVCD"); AppendMenu(gui->menu, MF_STRING | MF_POPUP, (UINT) gui->diskmenu, "Play &CD/DVD/VCD/SVCD");
AppendMenu(gui->menu, MF_SEPARATOR, 0, 0); AppendMenu(gui->menu, MF_SEPARATOR, 0, 0);
#ifdef USE_SUB
AppendMenu(gui->menu, MF_STRING, IDSUBTITLE_OPEN, "Open Subtitle"); AppendMenu(gui->menu, MF_STRING, IDSUBTITLE_OPEN, "Open Subtitle");
#endif
AppendMenu(gui->menu, MF_STRING, ID_SKINBROWSER, "Skin Browser"); AppendMenu(gui->menu, MF_STRING, ID_SKINBROWSER, "Skin Browser");
AppendMenu(gui->menu, MF_SEPARATOR, 0, 0); AppendMenu(gui->menu, MF_SEPARATOR, 0, 0);
AppendMenu(gui->menu, MF_STRING, ID_PREFS, "Preferences"); AppendMenu(gui->menu, MF_STRING, ID_PREFS, "Preferences");
@ -1214,9 +1208,7 @@ static void create_traymenu(gui_t *gui)
AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0); AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0);
AppendMenu(gui->traymenu, MF_STRING, ID_MUTE, "Toggle Mute"); AppendMenu(gui->traymenu, MF_STRING, ID_MUTE, "Toggle Mute");
AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0); AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0);
#ifdef USE_SUB
AppendMenu(gui->traymenu, MF_STRING, IDSUBTITLE_OPEN, "Open Subtitle"); AppendMenu(gui->traymenu, MF_STRING, IDSUBTITLE_OPEN, "Open Subtitle");
#endif
AppendMenu(gui->traymenu, MF_STRING, ID_PLAYLIST, "Playlist"); AppendMenu(gui->traymenu, MF_STRING, ID_PLAYLIST, "Playlist");
AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0); AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0);
AppendMenu(gui->traymenu, MF_STRING, ID_SHOWHIDE, "Show/Hide"); AppendMenu(gui->traymenu, MF_STRING, ID_SHOWHIDE, "Show/Hide");

View File

@ -111,8 +111,6 @@ extern void display_skinbrowser(gui_t *gui);
extern void display_chapterselwindow(gui_t *gui); extern void display_chapterselwindow(gui_t *gui);
extern void display_eqwindow(gui_t *gui); extern void display_eqwindow(gui_t *gui);
extern void display_prefswindow(gui_t *gui); extern void display_prefswindow(gui_t *gui);
#ifdef USE_SUB
extern void display_opensubtitlewindow(gui_t *gui); extern void display_opensubtitlewindow(gui_t *gui);
#endif
#endif #endif

View File

@ -750,12 +750,10 @@ int guiGetEvent(int type, char *arg)
if(fullscreen) guiSetEvent(evFullScreen); if(fullscreen) guiSetEvent(evFullScreen);
PostMessage(mygui->mainwindow, WM_COMMAND, (WPARAM) IDFILE_OPEN, 0); PostMessage(mygui->mainwindow, WM_COMMAND, (WPARAM) IDFILE_OPEN, 0);
break; break;
#ifdef USE_SUB
case MP_CMD_GUI_LOADSUBTITLE: case MP_CMD_GUI_LOADSUBTITLE:
if(fullscreen) guiSetEvent(evFullScreen); if(fullscreen) guiSetEvent(evFullScreen);
PostMessage(mygui->mainwindow, WM_COMMAND, (WPARAM) IDSUBTITLE_OPEN, 0); PostMessage(mygui->mainwindow, WM_COMMAND, (WPARAM) IDSUBTITLE_OPEN, 0);
break; break;
#endif
default: default:
break; break;
} }

View File

@ -251,7 +251,6 @@
{"codecs-file", &codecs_file, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"codecs-file", &codecs_file, CONF_TYPE_STRING, 0, 0, 0, NULL},
// ------------------------- subtitles options -------------------- // ------------------------- subtitles options --------------------
#ifdef USE_SUB
{"sub", &sub_name, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, {"sub", &sub_name, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
#ifdef USE_FRIBIDI #ifdef USE_FRIBIDI
{"fribidi-charset", &fribidi_charset, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"fribidi-charset", &fribidi_charset, CONF_TYPE_STRING, 0, 0, 0, NULL},
@ -289,7 +288,6 @@
{"sub-bg-alpha", &sub_bg_alpha, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL}, {"sub-bg-alpha", &sub_bg_alpha, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL},
{"sub-no-text-pp", &sub_no_text_pp, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"sub-no-text-pp", &sub_no_text_pp, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"sub-fuzziness", &sub_match_fuzziness, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL}, {"sub-fuzziness", &sub_match_fuzziness, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL},
#endif
#ifdef USE_OSD #ifdef USE_OSD
{"font", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"font", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL},
{"ffactor", &font_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 10.0, NULL}, {"ffactor", &font_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 10.0, NULL},

1
configure vendored
View File

@ -7534,7 +7534,6 @@ $_def_named_asm_args
#define PREFIX "$_prefix" #define PREFIX "$_prefix"
#define USE_OSD 1 #define USE_OSD 1
#define USE_SUB 1
/* enable/disable SIGHANDLER */ /* enable/disable SIGHANDLER */
$_def_sighandler $_def_sighandler

View File

@ -199,10 +199,8 @@ int sub_auto = 0;
int subcc_enabled=0; int subcc_enabled=0;
int suboverlap_enabled = 1; int suboverlap_enabled = 1;
#ifdef USE_SUB
static sub_data* subdata=NULL; static sub_data* subdata=NULL;
float sub_last_pts = -303; float sub_last_pts = -303;
#endif
int auto_expand=1; int auto_expand=1;
int encode_duplicates=1; int encode_duplicates=1;
@ -649,7 +647,6 @@ if(sh_audio && (out_audio_codec || seek_to_sec || !sh_audio->wf || playback_spee
} }
} }
#ifdef USE_SUB
// after reading video params we should load subtitles because // after reading video params we should load subtitles because
// we know fps so now we can adjust subtitles time to ~6 seconds AST // we know fps so now we can adjust subtitles time to ~6 seconds AST
// check .sub // check .sub
@ -669,7 +666,6 @@ if(sh_audio && (out_audio_codec || seek_to_sec || !sh_audio->wf || playback_spee
free(tmp[i++]); free(tmp[i++]);
free(tmp); free(tmp);
} }
#endif
// set up video encoder: // set up video encoder:
@ -1477,7 +1473,6 @@ if(sh_audio && !demuxer2){
} }
fflush(stdout); fflush(stdout);
#ifdef USE_SUB
// find sub // find sub
if(subdata && sh_video->pts>0){ if(subdata && sh_video->pts>0){
float pts=sh_video->pts; float pts=sh_video->pts;
@ -1489,7 +1484,6 @@ if(sh_audio && !demuxer2){
sub_last_pts = pts; sub_last_pts = pts;
} }
} }
#endif
#ifdef USE_DVDREAD #ifdef USE_DVDREAD
// DVD sub: // DVD sub:

View File

@ -50,9 +50,7 @@ extern int mp_input_win32_slave_cmd_func(int fd,char* dest,int size);
#include "cfg-mplayer-def.h" #include "cfg-mplayer-def.h"
#ifdef USE_SUB
#include "subreader.h" #include "subreader.h"
#endif
#include "libvo/video_out.h" #include "libvo/video_out.h"
@ -340,12 +338,12 @@ char *vobsub_name=NULL;
/*DSP!!char *dsp=NULL;*/ /*DSP!!char *dsp=NULL;*/
int subcc_enabled=0; int subcc_enabled=0;
int suboverlap_enabled = 1; int suboverlap_enabled = 1;
#ifdef USE_SUB
sub_data* set_of_subtitles[MAX_SUBTITLE_FILES]; sub_data* set_of_subtitles[MAX_SUBTITLE_FILES];
int set_of_sub_size = 0; int set_of_sub_size = 0;
int set_of_sub_pos = -1; int set_of_sub_pos = -1;
double sub_last_pts = -303; double sub_last_pts = -303;
#endif
int global_sub_size = 0; // this encompasses all subtitle sources int global_sub_size = 0; // this encompasses all subtitle sources
int global_sub_pos = -1; // this encompasses all subtitle sources int global_sub_pos = -1; // this encompasses all subtitle sources
#define SUB_SOURCE_SUBS 0 #define SUB_SOURCE_SUBS 0
@ -963,8 +961,6 @@ int sub_source(void)
return source; return source;
} }
#ifdef USE_SUB
sub_data* subdata = NULL; sub_data* subdata = NULL;
static subtitle* vo_sub_last = NULL; static subtitle* vo_sub_last = NULL;
@ -1029,7 +1025,6 @@ void update_set_of_subtitles(void)
++set_of_sub_size; ++set_of_sub_size;
} }
} }
#endif /* USE_SUB */
void init_vo_spudec(void) { void init_vo_spudec(void) {
if (vo_spudec) if (vo_spudec)
@ -1259,7 +1254,6 @@ static int build_afilter_chain(sh_audio_t *sh_audio, ao_data_t *ao_data)
return result; return result;
} }
#ifdef USE_SUB
/** /**
* \brief Log the currently displayed subtitle to a file * \brief Log the currently displayed subtitle to a file
* *
@ -1294,7 +1288,6 @@ static void log_sub(void){
} }
fclose(f); fclose(f);
} }
#endif /* USE_SUB */
/// \defgroup OSDMsgStack OSD message stack /// \defgroup OSDMsgStack OSD message stack
/// ///
@ -2203,7 +2196,6 @@ static int mp_property_aspect(m_option_t* prop,int action,void* arg) {
/// Text subtitle position (RW) /// Text subtitle position (RW)
static int mp_property_sub_pos(m_option_t* prop,int action,void* arg) { static int mp_property_sub_pos(m_option_t* prop,int action,void* arg) {
#ifdef USE_SUB
if(!sh_video) return M_PROPERTY_UNAVAILABLE; if(!sh_video) return M_PROPERTY_UNAVAILABLE;
switch(action) { switch(action) {
@ -2215,9 +2207,6 @@ static int mp_property_sub_pos(m_option_t* prop,int action,void* arg) {
default: default:
return m_property_int_range(prop,action,arg,&sub_pos); return m_property_int_range(prop,action,arg,&sub_pos);
} }
#else
return M_PROPERTY_UNAVAILABLE;
#endif
} }
/// Selected subtitles (RW) /// Selected subtitles (RW)
@ -2237,15 +2226,12 @@ static int mp_property_sub(m_option_t* prop,int action,void* arg) {
*(char**)arg = malloc(64); *(char**)arg = malloc(64);
(*(char**)arg)[63] = 0; (*(char**)arg)[63] = 0;
sub_name = 0; sub_name = 0;
#ifdef USE_SUB
if(subdata) if(subdata)
sub_name = subdata->filename; sub_name = subdata->filename;
#endif
#ifdef USE_ASS #ifdef USE_ASS
if (ass_track && ass_track->name) if (ass_track && ass_track->name)
sub_name = ass_track->name; sub_name = ass_track->name;
#endif #endif
#if defined(USE_SUB) || defined(USE_ASS)
if(sub_name) { if(sub_name) {
char *tmp,*tmp2; char *tmp,*tmp2;
tmp = sub_name; tmp = sub_name;
@ -2258,7 +2244,6 @@ static int mp_property_sub(m_option_t* prop,int action,void* arg) {
strlen(tmp) < 20 ? tmp : tmp+strlen(tmp)-19); strlen(tmp) < 20 ? tmp : tmp+strlen(tmp)-19);
return M_PROPERTY_OK; return M_PROPERTY_OK;
} }
#endif
if (demuxer->type == DEMUXER_TYPE_MATROSKA && dvdsub_id >= 0) { if (demuxer->type == DEMUXER_TYPE_MATROSKA && dvdsub_id >= 0) {
char lang[40] = MSGTR_Unknown; char lang[40] = MSGTR_Unknown;
demux_mkv_get_sub_lang(demuxer, dvdsub_id, lang, 9); demux_mkv_get_sub_lang(demuxer, dvdsub_id, lang, 9);
@ -2328,11 +2313,10 @@ static int mp_property_sub(m_option_t* prop,int action,void* arg) {
global_sub_indices[SUB_SOURCE_DEMUX], global_sub_indices[SUB_SOURCE_DEMUX],
global_sub_pos, source); global_sub_pos, source);
#ifdef USE_SUB
set_of_sub_pos = -1; set_of_sub_pos = -1;
subdata = NULL; subdata = NULL;
vo_sub_last = vo_sub = NULL; vo_sub_last = vo_sub = NULL;
#endif
vobsub_id = -1; vobsub_id = -1;
dvdsub_id = -1; dvdsub_id = -1;
if (d_dvdsub) { if (d_dvdsub) {
@ -2345,7 +2329,6 @@ static int mp_property_sub(m_option_t* prop,int action,void* arg) {
if (source == SUB_SOURCE_VOBSUB) { if (source == SUB_SOURCE_VOBSUB) {
vobsub_id = global_sub_pos - global_sub_indices[SUB_SOURCE_VOBSUB]; vobsub_id = global_sub_pos - global_sub_indices[SUB_SOURCE_VOBSUB];
#ifdef USE_SUB
} else if (source == SUB_SOURCE_SUBS) { } else if (source == SUB_SOURCE_SUBS) {
set_of_sub_pos = global_sub_pos - global_sub_indices[SUB_SOURCE_SUBS]; set_of_sub_pos = global_sub_pos - global_sub_indices[SUB_SOURCE_SUBS];
#ifdef USE_ASS #ifdef USE_ASS
@ -2357,7 +2340,6 @@ static int mp_property_sub(m_option_t* prop,int action,void* arg) {
subdata = set_of_subtitles[set_of_sub_pos]; subdata = set_of_subtitles[set_of_sub_pos];
vo_osd_changed(OSDTYPE_SUBTITLE); vo_osd_changed(OSDTYPE_SUBTITLE);
} }
#endif
} else if (source == SUB_SOURCE_DEMUX) { } else if (source == SUB_SOURCE_DEMUX) {
dvdsub_id = global_sub_pos - global_sub_indices[SUB_SOURCE_DEMUX]; dvdsub_id = global_sub_pos - global_sub_indices[SUB_SOURCE_DEMUX];
if (d_dvdsub) { if (d_dvdsub) {
@ -2391,9 +2373,7 @@ static int mp_property_sub(m_option_t* prop,int action,void* arg) {
} }
} }
} else { // off } else { // off
#ifdef USE_SUB
vo_osd_changed(OSDTYPE_SUBTITLE); vo_osd_changed(OSDTYPE_SUBTITLE);
#endif
if(vo_spudec) vo_osd_changed(OSDTYPE_SPU); if(vo_spudec) vo_osd_changed(OSDTYPE_SPU);
} }
#ifdef USE_DVDREAD #ifdef USE_DVDREAD
@ -2415,7 +2395,6 @@ static int mp_property_sub_delay(m_option_t* prop,int action,void* arg) {
/// Alignment of text subtitles (RW) /// Alignment of text subtitles (RW)
static int mp_property_sub_alignment(m_option_t* prop,int action,void* arg) { static int mp_property_sub_alignment(m_option_t* prop,int action,void* arg) {
#ifdef USE_SUB
char* name[] = { MSGTR_Top, MSGTR_Center, MSGTR_Bottom }; char* name[] = { MSGTR_Top, MSGTR_Center, MSGTR_Bottom };
if(!sh_video || global_sub_pos < 0 || sub_source() != SUB_SOURCE_SUBS) if(!sh_video || global_sub_pos < 0 || sub_source() != SUB_SOURCE_SUBS)
@ -2435,14 +2414,10 @@ static int mp_property_sub_alignment(m_option_t* prop,int action,void* arg) {
default: default:
return m_property_choice(prop,action,arg,&sub_alignment); return m_property_choice(prop,action,arg,&sub_alignment);
} }
#else
return M_PROPERTY_UNAVAILABLE;
#endif
} }
/// Subtitle visibility (RW) /// Subtitle visibility (RW)
static int mp_property_sub_visibility(m_option_t* prop,int action,void* arg) { static int mp_property_sub_visibility(m_option_t* prop,int action,void* arg) {
#ifdef USE_SUB
if(!sh_video) return M_PROPERTY_UNAVAILABLE; if(!sh_video) return M_PROPERTY_UNAVAILABLE;
switch(action) { switch(action) {
@ -2455,9 +2430,6 @@ static int mp_property_sub_visibility(m_option_t* prop,int action,void* arg) {
default: default:
return m_property_flag(prop,action,arg,&sub_visibility); return m_property_flag(prop,action,arg,&sub_visibility);
} }
#else
return M_PROPERTY_UNAVAILABLE;
#endif
} }
/// Show only forced subtitles (RW) /// Show only forced subtitles (RW)
@ -2899,7 +2871,6 @@ static double playing_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio,
static void update_subtitles(void) static void update_subtitles(void)
{ {
#ifdef USE_SUB
// find sub // find sub
if (subdata) { if (subdata) {
double pts = sh_video->pts; double pts = sh_video->pts;
@ -2913,7 +2884,6 @@ static void update_subtitles(void)
sub_last_pts = pts; sub_last_pts = pts;
} }
} }
#endif
// DVD sub: // DVD sub:
if (vo_config_count && vo_spudec) { if (vo_config_count && vo_spudec) {
@ -4419,7 +4389,6 @@ if(vo_spudec==NULL && sh_video &&
if (vo_spudec!=NULL) if (vo_spudec!=NULL)
spudec_set_forced_subs_only(vo_spudec,forced_subs_only); spudec_set_forced_subs_only(vo_spudec,forced_subs_only);
#ifdef USE_SUB
if(sh_video) { if(sh_video) {
// after reading video params we should load subtitles because // after reading video params we should load subtitles because
// we know fps so now we can adjust subtitle time to ~6 seconds AST // we know fps so now we can adjust subtitle time to ~6 seconds AST
@ -4446,7 +4415,6 @@ if(sh_video) {
global_sub_size += set_of_sub_size; global_sub_size += set_of_sub_size;
} }
} }
#endif /* USE_SUB */
if (global_sub_size) { if (global_sub_size) {
// find the best sub to use // find the best sub to use
@ -4988,7 +4956,6 @@ if(step_sec>0) {
brk_cmd = 1; brk_cmd = 1;
} break; } break;
case MP_CMD_SUB_STEP : { case MP_CMD_SUB_STEP : {
#ifdef USE_SUB
if (sh_video) { if (sh_video) {
int movement = cmd->args[0].v.i; int movement = cmd->args[0].v.i;
step_sub(subdata, sh_video->pts, movement); step_sub(subdata, sh_video->pts, movement);
@ -4999,12 +4966,9 @@ if(step_sec>0) {
set_osd_msg(OSD_MSG_SUB_DELAY,1,osd_duration, set_osd_msg(OSD_MSG_SUB_DELAY,1,osd_duration,
MSGTR_OSDSubDelay, ROUND(sub_delay*1000)); MSGTR_OSDSubDelay, ROUND(sub_delay*1000));
} }
#endif
} break; } break;
case MP_CMD_SUB_LOG : { case MP_CMD_SUB_LOG : {
#ifdef USE_SUB
log_sub(); log_sub();
#endif
} break; } break;
case MP_CMD_OSD : { case MP_CMD_OSD : {
int v = cmd->args[0].v.i; int v = cmd->args[0].v.i;
@ -5203,7 +5167,6 @@ if(step_sec>0) {
#endif /* USE_TV */ #endif /* USE_TV */
case MP_CMD_SUB_LOAD: case MP_CMD_SUB_LOAD:
{ {
#ifdef USE_SUB
if (sh_video) { if (sh_video) {
int n = set_of_sub_size; int n = set_of_sub_size;
add_subtitles(cmd->args[0].v.s, sh_video->fps, 0); add_subtitles(cmd->args[0].v.s, sh_video->fps, 0);
@ -5213,11 +5176,9 @@ if(step_sec>0) {
++global_sub_size; ++global_sub_size;
} }
} }
#endif
} break; } break;
case MP_CMD_SUB_REMOVE: case MP_CMD_SUB_REMOVE:
{ {
#ifdef USE_SUB
if (sh_video) { if (sh_video) {
int v = cmd->args[0].v.i; int v = cmd->args[0].v.i;
sub_data *subd; sub_data *subd;
@ -5263,15 +5224,12 @@ if(step_sec>0) {
set_of_subtitles[set_of_sub_size] = NULL; set_of_subtitles[set_of_sub_size] = NULL;
} }
} }
#endif /* USE_SUB */
} break; } break;
case MP_CMD_GET_SUB_VISIBILITY: case MP_CMD_GET_SUB_VISIBILITY:
{ {
#ifdef USE_SUB
if (sh_video) { if (sh_video) {
mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_SUB_VISIBILITY=%d\n", sub_visibility); mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_SUB_VISIBILITY=%d\n", sub_visibility);
} }
#endif
} break; } break;
case MP_CMD_SCREENSHOT : case MP_CMD_SCREENSHOT :
if(vo_config_count){ if(vo_config_count){
@ -5677,7 +5635,6 @@ if(benchmark){
// time to uninit all, except global stuff: // time to uninit all, except global stuff:
uninit_player(INITED_ALL-(INITED_GUI+INITED_INPUT+(fixed_vo?INITED_VO:0))); uninit_player(INITED_ALL-(INITED_GUI+INITED_INPUT+(fixed_vo?INITED_VO:0)));
#ifdef USE_SUB
if ( set_of_sub_size > 0 ) if ( set_of_sub_size > 0 )
{ {
current_module="sub_free"; current_module="sub_free";
@ -5695,7 +5652,6 @@ uninit_player(INITED_ALL-(INITED_GUI+INITED_INPUT+(fixed_vo?INITED_VO:0)));
#ifdef USE_ASS #ifdef USE_ASS
ass_track = NULL; ass_track = NULL;
#endif #endif
#endif
if(eof == PT_NEXT_ENTRY || eof == PT_PREV_ENTRY) { if(eof == PT_NEXT_ENTRY || eof == PT_PREV_ENTRY) {
eof = eof == PT_NEXT_ENTRY ? 1 : -1; eof = eof == PT_NEXT_ENTRY ? 1 : -1;