diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-09-23 21:21:58 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-09-23 21:21:58 +0000 |
commit | bf16f6f4f329b7903ba550c458545fbdb41f5314 (patch) | |
tree | b9009935031d204f281367db020e88edb6e50702 /command.c | |
parent | 4834e2116289f92edc49dc8e595e70adcdc26cec (diff) | |
download | mpv-bf16f6f4f329b7903ba550c458545fbdb41f5314.tar.bz2 mpv-bf16f6f4f329b7903ba550c458545fbdb41f5314.tar.xz |
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
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; } |