📄 parstask.cpp
字号:
{
break;
}
}
angle_cell_start = i;
}
}
/* SPU should have forcibly display on UNLESS we are in stop, have zoom on, */
/* have the screensaver on or are changing display mode */
n_spst = (UBYTE)(get_sprm(SPRM_SPSTN_TT_DOM));
if (!zoom_on && (nav_state != STOPPED) )
{
spu_disp_force_on();
if ((n_spst & 0x40) || ((nvpck[CURRENT].hl_gi.hli_ss) && (nvpck[CURRENT].hl_gi.btn_ns))) /* display spu */
{
spu_disp_on();
}
else
{
spu_disp_off();
}
}
else
{
spu_disp_force_off();
if (!((n_spst & 0x40) || nvpck[CURRENT].hl_gi.hli_ss)) /* display spu */
{
spu_disp_off();
}
}
/* In order to test the CGMS on a drive that cannot play encrypted disks,
* the environment variable FORCE_CGMS will tell this function to force
* CGMS on the video output. */
#if 0
{
char *str;
str = getenv("FORCE_CGMS");
if ((str!=NULL) && (strncmp(str, "y", 1)==0))
{
video_ts.vob_cgms = 0xB0;
nvpck[CURRENT].pci_gi.apstb = 0x2;
}
}
#endif
/* If CGMS-A is present on the disk or if the disk is CSS, we need to disable
* upscalling according to the "CSS Procedural specifications for
* DVD up-scalling".
*/
new_cgms = vts_file[tt_srp[sprm[SPRM_TTN_TT_DOM] - 1].vtsn - 1].ts[tt_srp[sprm[SPRM_TTN_TT_DOM] - 1].vts_ttn].cgms;
if ((vob_cgms != new_cgms) || (prev_apstb != nvpck[CURRENT].pci_gi.apstb))
{
UBYTE ict;
USHORT macrovision;
PEiConfigureGetICT(tPE, &ict);
PEiConfigureGetVideoMacrovision(tPE, ¯ovision);
/* If Macrovision changed, apply the new value */
if (macrovision != (USHORT)nvpck[CURRENT].pci_gi.apstb)
PEiConfigureSetVideoMacrovision(tPE, (USHORT)nvpck[CURRENT].pci_gi.apstb);
/* make sure ICT is set if there is copy protection information */
if (((new_cgms & 0x80) == 0x80))
{
PEiConfigureSetICT(tPE, TRUE);
}
/* setCGMS on the output. */
PEiConfigureSetCGMS(tPE, ((new_cgms>>4)&0x3));
prev_apstb = nvpck[CURRENT].pci_gi.apstb;
vob_cgms = (UCHAR)(new_cgms);
}
if ( (angle_change & 0x01) && (c_pbi[next_cell - 1].c_cat[0] & 0x04) )
{
if ( (fAngleReady == FALSE) && (next_cell == (angle_cell_start + (angle_num_tt & 0x7f) - 1)))
{
sprm[SPRM_AGLN_TT_DOM] = angle_num_tt & 0x7f;
angle_num_tt = 0;
/* if the expected angle change is done and the event hasn't been set, set the event */
fAngleReady = TRUE;
angle_change = 0; /* angle has been changed */
}
}
/* send out OSD messages to indicate if there is angle or not in the current VOBU */
/* new angle change scheme */
if ((0x10 == (c_pbi[next_cell - 1].c_cat[0] & 0x30)) && /* angle block */
(TT_PGC == pgc_domain) && /* title domain */
(tt_srp[sprm[SPRM_TTN_TT_DOM]-1].agl_n > 1) && /* total angle > 1 */
(0x00 == (pgc_gi.pgc_uop_ctl[1] & 0x40)) && /* UOP angle change permitted */
((0x00 == (nvpck[CURRENT].pci_gi.vobu_uop_ctl[1] & 0x40)) && (pgc_mode >= PGC_PG_PLAY)))
{
/* current cell in angle block */
if (angle_flag == 0)
{
angle_flag = 1;
message[0] = VDVD_STATUS_ANGLE_ON;
message[1] = sprm[SPRM_AGLN_TT_DOM];
if (UsrEventHandler(message) != USR_SUCCESS)
{
DbgPrint(("\nUsrEventHandler FAILURE, %s, %d\n\n", __FILE__, __LINE__));
}
}
}
else
{
/* current cell in non-angle block */
if (angle_flag)
{
angle_flag = 0;
message[0] = VDVD_STATUS_ANGLE_OFF;
if (UsrEventHandler(message) != USR_SUCCESS)
{
DbgPrint(("\nUsrEventHandler FAILURE, %s, %d\n\n", __FILE__, __LINE__));
}
}
}
/* new angle change scheme */
/* Reset SCR if necessary */
if (((c_pbi[next_cell - 1].c_cat[0] & 0x02) || forcedly_reset_scr) && (reset_scr_flag & 0x01))
{
reset_scr_count++;
reset_scr_flag &= 0xfc;
forcedly_reset_scr = 0;
change_hl_forbidden = 0; /* clear the highlight change forbidden flag */
/** CELL_V1 ***/
if (reset_scr_flag & 0x04)
{
DBGPRINT(DBG_ON(DBG_TRACE), ("proc_nvpck: reset_scr_flag=%x, LINE=%d\n", reset_scr_flag, __LINE__));
send_another_cell_request = 1;
}
/**********************/
reset_scr_flag = 0;
}
/**** CELL_V1 *****/
if (reset_scr_flag & 0x01)
{
if (reset_scr_flag & 0x04)
{
DBGPRINT(DBG_ON(DBG_TRACE), ("proc_nvpck: reset_scr_flag=%x, LINE=%d\n", reset_scr_flag, __LINE__));
send_another_cell_request = 1;
}
reset_scr_flag = 0;
}
/***************************/
/* clear change_hl_forbidden based on highlight presentation time */
if (change_hl_forbidden)
{
if (nvpck[CURRENT].pci_gi.vobu_s_ptm >= hli_end_ptm)
{
change_hl_forbidden = 0;
}
}
/**************************************************************************/
/* CELL_V1 */
if ( (player_state != REVERSE) || (angle_change & 0x01) )
{
if ( (nvpck[CURRENT].vobu_sri[FWDI_NEXT] & 0xbfffffff) == SRI_END_OF_CELL )
{
/* If we are in an angle block, and there is an angle change in progress */
if ( ( (c_pbi[next_cell - 1].c_cat[0] & 0x10) != 0) && (angle_change & 0x0f) )
{
/* Note: We used to reset queue_nav here, but this can cause us to throw away
* the decode done or end of stream message so it was a bad idea. */
/* Since loader com queue has been clear, next cell request need to be re-sent */
DBGPRINT(DBG_ON(DBG_TRACE), ("proc_nvpck: Since loader com queue has been clear, next cell request need to be re-sent\n"));
send_another_cell_request = 1;
/* if the expected angle change is done and the event hasn't been set, set the event */
angle_num_tt = 0;
fAngleReady = TRUE;
/* force angle has been changed */
angle_change = 0;
}
}
}
/* record trick resume info */
trick_rsm_cell = (UBYTE)next_cell;
trick_resume_offset = nvpck[CURRENT].pci_gi.nv_pck_lbn;
/***
The following part is to handle the case that audio plays
over a still picture. When there's an error in the bitstream
the preparser discard the audio data. Since there's no video and
audio coming to the channel, the timer got from nvpck is updated
very fast and looks as if it's in FF mode. This part of code uses
a timer to control the speed of nvpck process so that the display
timer looks normal when illegal bitstream is encountered. Li 1/12/99
***/
/***
This is also required for some discs where at the start there exists
a still followed by a number of empty vobu's (no video or audio).
The following code is required to pace the stills in this case. Gareth 4/29/99
***/
if (nav_timer_counter > last_time)
{
time_interval = nav_timer_counter - last_time;
}
else /* wrapped around */
{
time_interval = 0xfffffffe - last_time + nav_timer_counter;
}
bin_cur_time = time_to_bin(nvpck[CURRENT].pci_gi.c_eltm); /* in *150 seconds */
last_nv_time = bin_cur_time;
last_time = nav_timer_counter;
/* Audio gap */
astn = get_sprm(SPRM_ASTN_TT_DOM) & 0x0f;
if (nvpck[CURRENT].sml_pbi.vob_a_stp_ptm1[astn] && nvpck[CURRENT].sml_pbi.vob_a_gap_len1[astn] && !AGAP_FLG && (S_AUDIO == 1) )
{
audio_gap( (ULONG*)&nvpck[CURRENT].sml_pbi.vob_a_stp_ptm1[astn], (ULONG*)&nvpck[CURRENT].sml_pbi.vob_a_stp_ptm2[astn],
(ULONG*)&nvpck[CURRENT].sml_pbi.vob_a_gap_len1[astn], (ULONG*)&nvpck[CURRENT].sml_pbi.vob_a_gap_len2[astn]);
}
/* Maintain synchronization of cell playback */
if ((c_posi[next_cell - 1].c_idn != nvpck[CURRENT].dsi_gi.vobu_c_idn) ||
(c_posi[next_cell - 1].c_vob_idn != nvpck[CURRENT].dsi_gi.vobu_vob_idn))
{
DBGPRINT(DBG_ON(DBG_TRACE), ("proc_nvpck: - cell playback not in sync\n"));
/*
* Get the corresponding cell from NV_PCK if not in sync
*/
for (i = 0; i < pgc_gi.pgc_cnt[3]; i++)
{
if ((c_posi[i].c_idn == nvpck[CURRENT].dsi_gi.vobu_c_idn) &&
(c_posi[i].c_vob_idn == nvpck[CURRENT].dsi_gi.vobu_vob_idn))
{
next_cell = i + 1;
break;
}
}
for (i = 0; i < (pgc_gi.pgc_cnt[2]&0x7f); i++)
{
if ((pgc_pgmap[i] <= next_cell) && (pgc_pgmap[i + 1] > next_cell))
{
next_pgn = i + 1;
break;
}
}
DBGPRINT(DBG_ON(DBG_TRACE), ("proc_nvpck: - next_cell=%d, next_pgn=%d\n", next_cell, next_pgn));
}
if (nv_tmr_100)
{
set_sprm(SPRM_NV_TMR, (USHORT)(nv_tmr_set) );
bin_start_time = time_to_bin(nvpck[CURRENT].pci_gi.c_eltm);
nv_tmr_100 = 0;
}
if (adjust_nv_tmr)
{
bin_cur_time = time_to_bin(nvpck[CURRENT].pci_gi.c_eltm) - bin_start_time;
if (bin_cur_time > 12)
{
bin_cur_time -= 12;
}
if (nv_tmr_set <= bin_cur_time / 150)
{
DBGPRINT(DBG_ON(DBG_ERROR), (">>> We used to freeze decode here <<<\n"));
message[0] = NAV_TIMER_EXPIRED;
if ( OS_MsgQSend(queue_nav, (char *)&message[0], NAV_MSG_SIZE, OS_NO_WAIT, OS_MSG_PRI_NORMAL) != OS_OK)
{
DbgPrint(("\nOS_MsgQSend FAILURE, %s, %d\n\n", __FILE__, __LINE__));
}
adjust_nv_tmr = 0;
if (sprm[SPRM_NV_TMR])
{
set_sprm(SPRM_NV_TMR, 0);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -