mirror of
https://github.com/mpv-player/mpv
synced 2025-03-20 10:17:31 +00:00
fixed SPU pts, it's 1024/90000 based instead of 1/100
spudec code doesn't requires dvdread - removed some #ifdefs - from dvdnav patch by Kees Cook <mplayer@outflux.net> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5489 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
686109014e
commit
d4eb53e0dc
16
mplayer.c
16
mplayer.c
@ -51,9 +51,8 @@ extern void* mDisplay; // Display* mDisplay;
|
||||
#ifdef USE_DVDNAV
|
||||
#include <dvdnav.h>
|
||||
#endif
|
||||
#ifdef USE_DVDREAD
|
||||
|
||||
#include "spudec.h"
|
||||
#endif
|
||||
#include "vobsub.h"
|
||||
|
||||
#include "linux/getch2.h"
|
||||
@ -301,14 +300,13 @@ void uninit_player(unsigned int mask){
|
||||
getch2_disable();
|
||||
}
|
||||
|
||||
#ifdef USE_DVDREAD
|
||||
if (mask&INITED_SPUDEC){
|
||||
inited_flags&=~INITED_SPUDEC;
|
||||
current_module="uninit_spudec";
|
||||
spudec_free(vo_spudec);
|
||||
vo_spudec=NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(mask&INITED_VO){
|
||||
inited_flags&=~INITED_VO;
|
||||
current_module="uninit_vo";
|
||||
@ -2575,9 +2573,7 @@ if(rel_seek_secs || abs_seek_pos){
|
||||
too_slow_frame_cnt=0;
|
||||
too_fast_frame_cnt=0;
|
||||
|
||||
#ifdef USE_DVDREAD
|
||||
if(vo_spudec) spudec_reset(vo_spudec);
|
||||
#endif
|
||||
if(vo_spudec) spudec_reset(vo_spudec);
|
||||
}
|
||||
}
|
||||
rel_seek_secs=0;
|
||||
@ -2683,7 +2679,6 @@ if(rel_seek_secs || abs_seek_pos){
|
||||
current_module=NULL;
|
||||
}
|
||||
|
||||
#ifdef USE_DVDREAD
|
||||
// DVD sub:
|
||||
if(vo_flags & 0x08){
|
||||
static vo_mpegpes_t packet;
|
||||
@ -2700,15 +2695,14 @@ if(rel_seek_secs || abs_seek_pos){
|
||||
current_module="spudec";
|
||||
while((len=ds_get_packet_sub(d_dvdsub,&packet))>0){
|
||||
mp_msg(MSGT_CPLAYER,MSGL_V,"\rDVD sub: len=%d v_pts=%5.3f s_pts=%5.3f \n",len,d_video->pts,d_dvdsub->pts);
|
||||
spudec_assemble(vo_spudec,packet,len,100*d_dvdsub->pts);
|
||||
spudec_assemble(vo_spudec,packet,len,90000*d_dvdsub->pts);
|
||||
}
|
||||
spudec_heartbeat(vo_spudec,100*d_video->pts);
|
||||
spudec_heartbeat(vo_spudec,90000*d_video->pts);
|
||||
|
||||
/* Don't know how to detect wether the sub has changed or not */
|
||||
vo_osd_changed(1);
|
||||
current_module=NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
} // while(!eof)
|
||||
|
||||
|
2
spudec.c
2
spudec.c
@ -196,7 +196,7 @@ static void spudec_process_control(spudec_handle_t *this, unsigned int pts100)
|
||||
next_off = this->control_start;
|
||||
while (start_off != next_off) {
|
||||
start_off = next_off;
|
||||
date = get_be16(this->packet + start_off);
|
||||
date = get_be16(this->packet + start_off) * 1024;
|
||||
next_off = get_be16(this->packet + start_off + 2);
|
||||
mp_msg(MSGT_SPUDEC,MSGL_DBG2, "date=%d\n", date);
|
||||
off = start_off + 4;
|
||||
|
Loading…
Reference in New Issue
Block a user