diff options
Diffstat (limited to 'mpcommon.c')
-rw-r--r-- | mpcommon.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/mpcommon.c b/mpcommon.c index 57d4f0536d..732bd1dbb5 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" @@ -42,9 +44,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) @@ -67,8 +69,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'; @@ -99,8 +103,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); @@ -144,15 +147,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; |