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 --- mpcommon.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mpcommon.c') diff --git a/mpcommon.c b/mpcommon.c index 394a71461f..e28614390d 100644 --- a/mpcommon.c +++ b/mpcommon.c @@ -66,13 +66,12 @@ 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, double refpts, demux_stream_t *d_dvdsub, int reset) { unsigned char *packet=NULL; int len; char type = d_dvdsub->sh ? ((sh_sub_t *)d_dvdsub->sh)->type : 'v'; static subtitle subs; - double refpts = sh_video->pts; if (reset) { sub_clear_text(&subs, MP_NOPTS_VALUE); if (vo_sub) { @@ -86,7 +85,7 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) } // find sub if (subdata) { - if (sub_fps==0) sub_fps = sh_video->fps; + if (sub_fps==0) sub_fps = sh_video ? sh_video->fps : 25; current_module = "find_sub"; if (refpts > sub_last_pts || refpts < sub_last_pts-1.0) { find_sub(subdata, (refpts+sub_delay) * -- cgit v1.2.3