summaryrefslogtreecommitdiffstats
path: root/mpcommon.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-23 21:21:58 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-23 21:21:58 +0000
commitbf16f6f4f329b7903ba550c458545fbdb41f5314 (patch)
treeb9009935031d204f281367db020e88edb6e50702 /mpcommon.c
parent4834e2116289f92edc49dc8e595e70adcdc26cec (diff)
downloadmpv-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 'mpcommon.c')
-rw-r--r--mpcommon.c5
1 files changed, 2 insertions, 3 deletions
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) *