From bf16f6f4f329b7903ba550c458545fbdb41f5314 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 23 Sep 2009 21:21:58 +0000 Subject: Make update_subtitles work without sh_video for text subtitles. This fixes a crash with e.g. auto-enabled subtitles and -novideo due to command.c calling update_subtitles even without video and is a step toward subtitle support for audio-only files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29710 b3059339-0415-0410-9bf9-f77b7e298cf2 --- command.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'command.c') diff --git a/command.c b/command.c index 5aee6ae383..3269db5949 100644 --- a/command.c +++ b/command.c @@ -1314,6 +1314,7 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg, demux_stream_t *const d_sub = mpctx->d_sub; const int global_sub_size = mpctx->global_sub_size; int source = -1, reset_spu = 0; + double pts = 0; char *sub_name; if (global_sub_size <= 0) @@ -1500,7 +1501,11 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg, d_sub->id = dvdsub_id; } #endif - update_subtitles(mpctx->sh_video, d_sub, 1); + if (mpctx->sh_audio) + pts = mpctx->sh_audio->pts; + if (mpctx->sh_video) + pts = mpctx->sh_video->pts; + update_subtitles(mpctx->sh_video, pts, d_sub, 1); return M_PROPERTY_OK; } -- cgit v1.2.3