diff options
Diffstat (limited to 'mpcommon.c')
-rw-r--r-- | mpcommon.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/mpcommon.c b/mpcommon.c index ba738dcee4..245383c803 100644 --- a/mpcommon.c +++ b/mpcommon.c @@ -1,4 +1,6 @@ #include <stdlib.h> +#include "mpcommon.h" +#include "options.h" #include "stream/stream.h" #include "libmpdemux/demuxer.h" #include "libmpdemux/stheader.h" @@ -12,15 +14,14 @@ #include "version.h" #include "vobsub.h" #include "stream/tv.h" -#include "libavutil/intreadwrite.h" +#include "ffmpeg_files/intreadwrite.h" #include "m_option.h" double sub_last_pts = -303; #ifdef CONFIG_ASS -#include "libass/ass.h" -#include "libass/ass_mp.h" -ass_track_t* ass_track = 0; // current track to render +#include "ass_mp.h" +ASS_Track *ass_track = 0; // current track to render #endif sub_data* subdata = NULL; @@ -40,9 +41,9 @@ void print_version(const char* name) gCpuCaps.has3DNow, gCpuCaps.has3DNowExt, gCpuCaps.hasSSE, gCpuCaps.hasSSE2, gCpuCaps.hasSSSE3); #if CONFIG_RUNTIME_CPUDETECT - mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithRuntimeDetection); + mp_tmsg(MSGT_CPLAYER,MSGL_V, "Compiled with runtime CPU detection.\n"); #else - mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithCPUExtensions); + mp_tmsg(MSGT_CPLAYER,MSGL_V, "Compiled for x86 CPU with extensions:"); if (HAVE_MMX) mp_msg(MSGT_CPLAYER,MSGL_V," MMX"); if (HAVE_MMX2) @@ -65,8 +66,10 @@ if (HAVE_CMOV) } -void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) +void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, + double video_offset, int reset) { + struct MPOpts *opts = sh_video->opts; unsigned char *packet=NULL; int len; char type = d_dvdsub->sh ? ((sh_sub_t *)d_dvdsub->sh)->type : 'v'; @@ -97,8 +100,7 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) } // DVD sub: - if (vo_config_count && vo_spudec && - (vobsub_id >= 0 || (dvdsub_id >= 0 && type == 'v'))) { + if (vo_spudec && (vobsub_id >= 0 || (opts->sub_id >= 0 && type == 'v'))) { int timestamp; current_module = "spudec"; spudec_heartbeat(vo_spudec, 90000*sh_video->timer); @@ -142,15 +144,16 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) if (spudec_changed(vo_spudec)) vo_osd_changed(OSDTYPE_SPU); - } else if (dvdsub_id >= 0 && (type == 't' || type == 'm' || type == 'a')) { + } else if (opts->sub_id >= 0 + && (type == 't' || type == 'm' || type == 'a')) { double curpts = sh_video->pts + sub_delay; double endpts; vo_sub = &subs; while (d_dvdsub->first) { - double pts = ds_get_next_pts(d_dvdsub); + double pts = ds_get_next_pts(d_dvdsub) + video_offset; if (pts > curpts) break; - endpts = d_dvdsub->first->endpts; + endpts = d_dvdsub->first->endpts + video_offset; len = ds_get_packet_sub(d_dvdsub, &packet); if (type == 'm') { if (len < 2) continue; @@ -251,26 +254,17 @@ int select_audio(demuxer_t* demuxer, int audio_id, char* audio_lang) /* Parse -noconfig common to both programs */ int disable_system_conf=0; int disable_user_conf=0; -#ifdef CONFIG_GUI -int disable_gui_conf=0; -#endif /* CONFIG_GUI */ /* Disable all configuration files */ static void noconfig_all(void) { disable_system_conf = 1; disable_user_conf = 1; -#ifdef CONFIG_GUI - disable_gui_conf = 1; -#endif /* CONFIG_GUI */ } const m_option_t noconfig_opts[] = { {"all", noconfig_all, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL}, {"system", &disable_system_conf, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 1, NULL}, {"user", &disable_user_conf, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 1, NULL}, -#ifdef CONFIG_GUI - {"gui", &disable_gui_conf, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 1, NULL}, -#endif /* CONFIG_GUI */ {NULL, NULL, 0, 0, 0, 0, NULL} }; |