Mercurial > mplayer.hg
comparison mplayer.c @ 29668:ecc719c6d7a9
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.
author | reimar |
---|---|
date | Wed, 23 Sep 2009 21:21:58 +0000 |
parents | 0e6de6bc0eec |
children | 2e3751815a21 |
comparison
equal
deleted
inserted
replaced
29667:8cfbe411de01 | 29668:ecc719c6d7a9 |
---|---|
1765 if (in_size > max_framesize) | 1765 if (in_size > max_framesize) |
1766 max_framesize = in_size; | 1766 max_framesize = in_size; |
1767 current_module = "decode video"; | 1767 current_module = "decode video"; |
1768 decoded_frame = decode_video(sh_video, start, in_size, drop_frame, pts); | 1768 decoded_frame = decode_video(sh_video, start, in_size, drop_frame, pts); |
1769 if (decoded_frame) { | 1769 if (decoded_frame) { |
1770 update_subtitles(sh_video, mpctx->d_sub, 0); | 1770 update_subtitles(sh_video, sh_video->pts, mpctx->d_sub, 0); |
1771 update_teletext(sh_video, mpctx->demuxer, 0); | 1771 update_teletext(sh_video, mpctx->demuxer, 0); |
1772 update_osd_msg(); | 1772 update_osd_msg(); |
1773 current_module = "filter video"; | 1773 current_module = "filter video"; |
1774 if (filter_video(sh_video, decoded_frame, sh_video->pts)) | 1774 if (filter_video(sh_video, decoded_frame, sh_video->pts)) |
1775 break; | 1775 break; |
2288 if (mpctx->sh_audio) | 2288 if (mpctx->sh_audio) |
2289 mpctx->delay -= frame_time; | 2289 mpctx->delay -= frame_time; |
2290 // video_read_frame can change fps (e.g. for ASF video) | 2290 // video_read_frame can change fps (e.g. for ASF video) |
2291 vo_fps = sh_video->fps; | 2291 vo_fps = sh_video->fps; |
2292 drop_frame = check_framedrop(frame_time); | 2292 drop_frame = check_framedrop(frame_time); |
2293 update_subtitles(sh_video, mpctx->d_sub, 0); | 2293 update_subtitles(sh_video, sh_video->pts, mpctx->d_sub, 0); |
2294 update_teletext(sh_video, mpctx->demuxer, 0); | 2294 update_teletext(sh_video, mpctx->demuxer, 0); |
2295 update_osd_msg(); | 2295 update_osd_msg(); |
2296 current_module = "decode_video"; | 2296 current_module = "decode_video"; |
2297 #ifdef CONFIG_DVDNAV | 2297 #ifdef CONFIG_DVDNAV |
2298 decoded_frame = mp_dvdnav_restore_smpi(&in_size,&start,decoded_frame); | 2298 decoded_frame = mp_dvdnav_restore_smpi(&in_size,&start,decoded_frame); |
2481 mpctx->delay = 0; | 2481 mpctx->delay = 0; |
2482 // Not all demuxers set d_video->pts during seek, so this value | 2482 // Not all demuxers set d_video->pts during seek, so this value |
2483 // (which is used by at least vobsub and edl code below) may | 2483 // (which is used by at least vobsub and edl code below) may |
2484 // be completely wrong (probably 0). | 2484 // be completely wrong (probably 0). |
2485 mpctx->sh_video->pts = mpctx->d_video->pts; | 2485 mpctx->sh_video->pts = mpctx->d_video->pts; |
2486 update_subtitles(mpctx->sh_video, mpctx->d_sub, 1); | 2486 update_subtitles(mpctx->sh_video, mpctx->sh_video->pts, mpctx->d_sub, 1); |
2487 update_teletext(mpctx->sh_video, mpctx->demuxer, 1); | 2487 update_teletext(mpctx->sh_video, mpctx->demuxer, 1); |
2488 } | 2488 } |
2489 | 2489 |
2490 if (mpctx->sh_audio) { | 2490 if (mpctx->sh_audio) { |
2491 current_module = "seek_audio_reset"; | 2491 current_module = "seek_audio_reset"; |