MPEG.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:17k
源码类别:

DVD

开发平台:

Others

  1. /****************************************************************************************
  2.  *  Copyright (c) 2000 ZORAN Corporation, All Rights Reserved
  3.  *  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
  4.  *
  5.  *  File: $Workfile: MPEG.c $             
  6.  *
  7.  * Description:
  8.  * ============
  9.  * MPEG Video Clip implementation
  10.  *
  11.  * Log:
  12.  * ====
  13.  ****************************************************************************************
  14.  * Updates:
  15.  ****************************************************************************************
  16.  * $Log: /I76/I76_Common/I76_Reference/Playcore/Nav_Clips/MPEG.c $
  17.  * 
  18.  * 31    04-04-03 14:06 Leslie
  19.  * Set initical Drive MSF when start MPEG clip playback
  20.  * 
  21.  * 30    04-03-12 17:44 Leslie
  22.  * Cancel Scan if switch from Scan mode to Pause mode
  23.  * 
  24.  * 29    04-03-04 14:06 Leslie
  25.  * Fix playback stuck problem after switch from Scan mode to Play mode
  26.  * 
  27.  * 28    04-03-03 19:08 Fwang
  28.  * Fix video garbage when skip between MPEG clips after zoom.
  29.  * 
  30.  * 27    04-02-25 17:39 Fwang
  31.  * CPU scaling for MPEG clips.
  32.  * 
  33.  * 26    1/25/04 8:21 Nmaurer
  34.  * Add drv_ prefix to Drive routines
  35.  * 
  36.  * 25    11/28/03 7:24p Leslie
  37.  * Change order of DEC_SetDiskType() and DEC_Prepare_to_decode()
  38.  * 
  39.  * 24    11/15/03 7:10p Leslie
  40.  * Replace old  Video API Low Level Files with new ones
  41.  * 
  42.  * 23    11/11/03 12:51p Leslie
  43.  * Fix the first time can't start MPEG DVD-ROM CLip playback after disc
  44.  * loading
  45.  * 
  46.  * 19    03-09-05 19:41 Leslie
  47.  * Add sequence header detection for MPEG Clips
  48.  * 
  49.  * 18    03-08-29 0:03 Leslie
  50.  * Add support for DVD-ROM Clips discs
  51.  * Code cleanup
  52.  * 
  53.  * 17    03-08-06 18:20 Leonh
  54.  * enable FF and FR when pause or stepf
  55.  * 
  56.  * 16    03-08-04 21:04 Leonh
  57.  * make mpeg ab repeat work ok
  58.  * 
  59.  * 15    03-07-30 21:07 Leslie
  60.  * Remove sequence header detection for MPEG Clips
  61.  * 
  62.  * 14    03-07-29 19:47 Leslie
  63.  * Set the right disc type for MPEG Clips
  64.  * 
  65.  * 13    03-06-18 18:17 Leonh
  66.  * use PTS as the mpeg current time display
  67.  * 
  68.  * 12    03-06-17 10:38 Leonh
  69.  * sovle the mpeg scan problem
  70.  * 
  71.  * 11    03-05-30 10:14 Jerryc
  72.  * fix flash card code.
  73.  * 
  74.  * 10    03-05-29 18:02 Jerryc
  75.  * support flash card.
  76.  * 
  77.  * 9     03-05-19 13:42 Leslie
  78.  * Add drive Play Mode
  79.  * 
  80.  * 8     03-03-04 11:34 Jerryc
  81.  * jerry cai, merge new nav clips lib 
  82.  * 
  83.  * 6     03-02-06 18:31 Leslie
  84.  * Add MPEGClip_Pause function
  85.  * 
  86.  * 5     03-02-06 14:26 Leslie
  87.  * Enable MPEG clip
  88.  * Support MPEG Clip Scan
  89.  * 
  90.  * 4     03-02-02 17:30 Leslie
  91.  * 
  92.  * 3     03-01-10 12:21 Leslie
  93.  * Add wide-character strings support
  94.  * 
  95.  * 2     03-01-09 12:30 Leslie
  96.  * 
  97.  * 1     10/30/02 18:06 Rond
  98.  * 
  99.  * 1     11/09/02 15:48 Atai
  100.  * 
  101.  * 1     26/08/02 16:05 Nirm
  102.  ****************************************************************************************/
  103. #include "Config.h" // Global Configuration - do not remove!
  104. #ifdef _DEBUG
  105. #undef IFTRACE
  106. #define IFTRACE if (gTraceNavigator)
  107. #include "DebugDbgMain.h"
  108. #endif
  109. #include "Includemath-macro.h"
  110. #include "DecoderDecoder.h"
  111. #include "DecoderDec_defs.h"
  112. #include "Decoderlow_levelDEC_LL_Def.h"
  113. #include "Decoderlow_levelDEC_LL_Api.h"
  114. #include "Drivedrv_api.h"
  115. #include "Drivedrv_defs.h"
  116. #include "LogoLogo.h"
  117. #include "PlaycoreCoremainCoreGDef.h"
  118. #include "PlaycoreAuxCacheAuxCache.h"
  119. #include "PlaycoreFileSysFileSystem.h"
  120. #include "Playcorenav_cddape_cd.h"
  121. #include "PlaycoreNav_ClipsMPEG.h"
  122. #include "PlaycoreNav_ClipsClip_Impl.h"
  123. #include "PlaycoreNav_ClipsGenericClip.h"
  124. #include "PlaycoreNav_ClipsNav_Clips.h"
  125. #include "PlaycoreNav_ClipsPE_Clips.h"
  126. #ifdef SUPPORT_FLASH_CARD
  127. #include "DriveFE_Manager.h"
  128. #endif
  129. /////////////////////////////////////////////////////////////////////////////
  130. // CONST Definition
  131. ////////////////////////////////////////////////////////////////////////////
  132. #define DRIVE_CLOCK_RATE 75L
  133. #define MPEG_SEARCH_ADDRESS_OFFSET 300L//4 s
  134. extern DWORD CurrLocationBackup;
  135. extern BYTE g_audio_sid;
  136. /////////////////////////////////////////////////////////////////////////////
  137. // General MPEG
  138. /////////////////////////////////////////////////////////////////////////////
  139. /////////////////////////////////////////////////////////////////////////////
  140. // Public Services
  141. #pragma argsused
  142. void MPEG_setPresentationTime(UINT8 uPresentationTime)
  143. {
  144. dbg_printf(("WARNING: MPEG_setPresentationTime() Failed: MPEG Video Clips cannot have a presentation time.n"));
  145. }
  146. /////////////////////////////////////////////////////////////////////////////
  147. // MPEG Video Clip
  148. /////////////////////////////////////////////////////////////////////////////
  149. /////////////////////////////////////////////////////////////////////////////
  150. // Forward Declarations of Virtual Methods
  151. BOOL MPEGClip_getExtendedInfo(const struct Clip_TAG *i_pThis, 
  152.  WORD i_pExtInfo_sc_handle);
  153. void MPEGClip_refresh(Clip *i_pThis);
  154. BOOL MPEGClip_play(Clip *i_pThis, const ClipMarker *i_pResumeMarker,
  155.   BOOL bCacheOnly);
  156. void MPEG_scan(Clip *i_pThis, int iScanSpeed);
  157. void MPEGClip_pause(Clip *i_pThis, BOOL bEnable);
  158. UINT16 MPEGClip_getTime(const Clip *i_pThis);
  159. void MPEGClip_recordMarker(const Clip *i_pThis, ClipMarker *o_pMarker);
  160. /////////////////////////////////////////////////////////////////////////////
  161. // Const Factory
  162. // Valid Extenions List
  163. BEGIN_CLIP_VALID_EXTENSIONS_MAP(MPEG)
  164. CLIP_VALID_EXTENSIONS_ENTRY(L"MPG")
  165. CLIP_VALID_EXTENSIONS_ENTRY(L"MPE")
  166. CLIP_VALID_EXTENSIONS_ENTRY(L"VOB")
  167. CLIP_VALID_EXTENSIONS_ENTRY(L"DAT")
  168. CLIP_VALID_EXTENSIONS_ENTRY(L"MPEG")
  169. END_CLIP_VALID_EXTENSIONS_MAP()
  170. // Constant Attributes
  171. DECLARE_CLIP_CONST_ATTR(MPEG, 
  172. DECLARE_CLIP_VTABLE(MPEGClip_getExtendedInfo,
  173. MPEGClip_play,//GenericClip_play,
  174. MPEGClip_pause,//GenericClip_pause,
  175. GenericClip_getStatus,
  176. GenericClip_abort,
  177. MPEGClip_recordMarker,//GenericClip_recordMarker,
  178. GenericClip_refresh,
  179. MPEGClip_getTime,
  180. GenericClip_digest,
  181. MPEG_scan//GenericClip_scan
  182. ),
  183. eClipType_MPEG,
  184. 0xC0, 0xE0, DEC_DISC_TYPE_MPEG,
  185. (eCA_Zoomable | eCA_Markable | eCA_Slowable | eCA_Scanable ),
  186. NULL
  187. )
  188. /////////////////////////////////////////////////////////////////////////////
  189. // Public Services
  190. BOOL MPEGClip_isKindOf(LPCWSTR i_pszFilename)
  191. {
  192. return GenericClip_isKindOf(i_pszFilename, CLIP_VALID_EXTENSIONS(MPEG));
  193. }
  194. void MPEGClip_construct(Clip *o_pThis, const FindData *i_pFileInfo)
  195. {
  196. GenericClip_construct(o_pThis, i_pFileInfo);
  197. o_pThis->m_pConstAttr= &CLIP_CONST_ATTR(MPEG);
  198. }
  199. /////////////////////////////////////////////////////////////////////////////
  200. // Virtual Methods
  201. BOOL MPEGClip_getExtendedInfo(const struct Clip_TAG *i_pThis, 
  202.  WORD i_pExtInfo_sc_handle)
  203. {
  204. DWORD dwStartLBA;
  205. ULONG ulBlocksCnt;
  206. ULONG cbPlaybackLength;
  207. UINT16 uTime;
  208. UINT32 SampleRate = 0;
  209. DEC_MuteOutput(MUTE_DETECT_REQUEST, MUTE_SETTING_ON);
  210. DEC_MuteSPDIF(MUTE_DETECT_REQUEST, MUTE_SETTING_ON);
  211. dwStartLBA= (i_pThis->m_cfiInfo).dwFileLocation;
  212. // Calculate the Playback Length (in Bytes)
  213. cbPlaybackLength= ( (i_pThis->m_cfiInfo).cbFileSize - 
  214. (LOGICAL_BLOCK_SIZE * (dwStartLBA - (i_pThis->m_cfiInfo).dwFileLocation)) );
  215. ulBlocksCnt= ((cbPlaybackLength + LOGICAL_BLOCK_SIZE - 1) / LOGICAL_BLOCK_SIZE);
  216. DEC_Stop_DVP_ADP_cmd((UINT8)0);
  217. DEC_SetDiskType((i_pThis->m_pConstAttr)->m_eBitstreamType);
  218. // Prepare for decoding
  219. DEC_prepare_to_decode();
  220. DEC_SetSID( DEC_SID_TYPE_VIDEO, (BYTE)NoVideo);
  221. DEC_SetSID(DEC_SID_TYPE_AUDIO, (i_pThis->m_pConstAttr)->m_eAudioSID);
  222. PE_CD_CancelNotification(IFrame);
  223. //Inform the Decoder of the Playback-Range
  224. PE_Clips_SetPlaybackRange(dwStartLBA, ulBlocksCnt, UNLIMITED_FILE_SIZE);
  225. // Invoke playback of the Decoder & Drive
  226. // NOTE: The order of invocation is important, and must not be changed!
  227. DEC_PlaybackCommand(DEC_PLAYBACK_CMD_PLAY, NULL);
  228. //LX051703: Add AV Data mode for Play CD
  229. PE_Clips_Playback_Sectors(DRVCF_CDSPEED_MAX | DRVF_PLAY_CD_AV_DATA, dwStartLBA, ulBlocksCnt);
  230. gns.clips.iClipSamplingRate = DEC_Get_MPEG_Audio_SamplingRate();
  231. drv_abort_play();
  232. DEC_PlaybackCommand(DEC_PLAYBACK_CMD_STOP, NULL);
  233. DEC_MuteOutput(MUTE_DETECT_REQUEST, ((g_audio_sid == 0xFF)?MUTE_SETTING_ON:MUTE_SETTING_OFF));
  234. DEC_MuteSPDIF(MUTE_DETECT_REQUEST, MUTE_SETTING_OFF);
  235. return TRUE;
  236. }
  237. BOOL MPEGClip_play(Clip *i_pThis, const ClipMarker *i_pResumeMarker,
  238.   BOOL bCacheOnly)
  239. {
  240. DWORD dwStartLBA;
  241. ULONG ulBlocksCnt, cbPlaybackLength;
  242. UINT16 uTime;
  243. dbg_printf(("GenericClip_play()n"));
  244. // Cached-playback is unsupported by default
  245. if (bCacheOnly)
  246. return FALSE;
  247. // No Logo for MPEG Bitstream
  248. Logo_selectSource(eFrame);
  249. Logo_display();
  250.  
  251. if (NULL == i_pResumeMarker) {
  252. // Start at the beginning
  253. dwStartLBA= (i_pThis->m_cfiInfo).dwFileLocation;
  254. }
  255. else {
  256. // Playback is being resumed
  257. dwStartLBA= i_pResumeMarker->dwAddress;
  258. }
  259. // Calculate the Playback Length (in Bytes)
  260. cbPlaybackLength= ( (i_pThis->m_cfiInfo).cbFileSize - 
  261. (LOGICAL_BLOCK_SIZE * (dwStartLBA - (i_pThis->m_cfiInfo).dwFileLocation)) );
  262. ulBlocksCnt= ((cbPlaybackLength + LOGICAL_BLOCK_SIZE - 1) / LOGICAL_BLOCK_SIZE);
  263. #ifndef MPEG_SCALING_BY_CPU
  264. // Kill any existing Zoom
  265. DEC_SetZoomScale(NO_ZOOM);
  266. #endif
  267. // Configure the Decoder to the appropriate Bitstream Type
  268. DEC_Stop_DVP_ADP_cmd((UINT8)0);
  269. DEC_SetDiskType((i_pThis->m_pConstAttr)->m_eBitstreamType);
  270. PE_CD_AutoDetectVideoSetting((i_pThis->m_pConstAttr)->m_eVideoSID, (i_pThis->m_cfiInfo).dwFileLocation, ulBlocksCnt);
  271. #ifdef MPEG_SCALING_BY_CPU
  272. DEC_EnableManualScaling(PROG_SCALER_MODE_CCRAM);
  273. // JG_0819_2004: FF/FB->PLAY/PAUSE need not to do scaling again
  274. if (NULL == i_pResumeMarker)
  275. gcst.mNeedScaling = TRUE;
  276. /* Set the scaler mode */
  277. DEC_SetViewMode(gps->view_mode);
  278. /* Set TV display aspect ratio */
  279. DEC_set_Display_AspectRatio(gps->tv_shape);
  280. #else
  281. DEC_DisableManualScaling();
  282. #endif
  283. // Prepare for decoding
  284. DEC_prepare_to_decode();
  285. DEC_SetSID(DEC_SID_TYPE_AUDIO, (i_pThis->m_pConstAttr)->m_eAudioSID);
  286. DEC_SetSID(DEC_SID_TYPE_VIDEO, (i_pThis->m_pConstAttr)->m_eVideoSID);
  287. // Select the appropriate Clock
  288. PE_Clips_SelectClock(eCT_Drive);
  289. uTime = (UINT16)( ((i_pThis->m_cfiInfo).dwFileLocation)/DRIVE_CLOCK_RATE);
  290. PE_CD_CancelNotification(IFrame);
  291. // Inform the Decoder of the Playback-Range
  292. PE_Clips_SetPlaybackRange(dwStartLBA, ulBlocksCnt, UNLIMITED_FILE_SIZE);
  293. // Invoke playback of the Decoder & Drive
  294. // NOTE: The order of invocation is important, and must not be changed!
  295. DEC_PlaybackCommand(DEC_PLAYBACK_CMD_PLAY, NULL);
  296. PE_CD_SetCurrentLocationLBN_Bakcup(dwStartLBA);
  297. //LX051703: Add AV Data mode for Play CD
  298. PE_Clips_Playback_Sectors(DRVCF_CDSPEED_1X | DRVF_PLAY_CD_AV_DATA, dwStartLBA, ulBlocksCnt);
  299. PE_Clips_EnableClock(TRUE, TRUE,uTime);
  300. return TRUE;
  301. }
  302. void MPEG_scan(Clip *i_pThis, int iScanSpeed)
  303. {
  304. DWORD dwCurrentAddress;
  305. dbg_printf(("MPEG Scann"));
  306. if((iScanSpeed!=0)&&(gcs.pstate==PST_SLOW)&&(gns.clips.iSlowSpeed>0))
  307. {
  308. PE_CD_SetSlowMotion(FALSE, 0);
  309. gcs.pstate = PST_PLAY;
  310. gns.clips.iSlowSpeed = 0;
  311. }
  312. if(iScanSpeed * gns.clips.iScanSpeed > 0)
  313. {
  314. gns.clips.iScanSpeed= ((iScanSpeed >= 0) ? iScanSpeed : (iScanSpeed - 1));
  315. return;
  316. }
  317. if ( iScanSpeed != 0 ){
  318. if ( PST_PLAY == gcs.pstate ||PST_SCAN == gcs.pstate  ||PST_PAUSE== gcs.pstate   ){
  319. DWORD dwPlaybackSize;
  320. CLEAR_COP_MASK(COP_ABREPEAT);
  321. gns.clips.iScanSpeed= ((iScanSpeed >= 0) ? iScanSpeed : (iScanSpeed - 1));
  322. // Start Scanning
  323. #ifndef SUPPORT_FLASH_CARD
  324. PE_CD_SetScan(TRUE, NoAudio, gns.clips.iScanSpeed);
  325. #endif
  326. gcs.pstate= PST_SCAN;
  327. dwCurrentAddress = PE_Clips_GetCurrLocation();
  328. dwPlaybackSize = (DWORD)(i_pThis->m_cfiInfo.cbFileSize >> 11) + 1 + (DWORD)(i_pThis->m_cfiInfo.dwFileLocation) - dwCurrentAddress;
  329. PE_CD_AbortPlayback(TRUE);
  330. #ifdef SUPPORT_FLASH_CARD
  331. // Start Scanning
  332. PE_CD_SetScan(TRUE, NoAudio, gns.clips.iScanSpeed);
  333. #endif
  334. // For AV Tracks only, request I-Frame notification
  335. PE_CD_RequestNotification(IFrame);
  336. // Prepare for decoding
  337. DEC_prepare_to_decode();
  338. DEC_SetSID(DEC_SID_TYPE_AUDIO, NoAudio);
  339. DEC_SetSID(DEC_SID_TYPE_VIDEO, 0xE0);
  340. // Inform the Decoder of the Playback-Range
  341. PE_Clips_SetPlaybackRange(dwCurrentAddress, dwPlaybackSize, UNLIMITED_FILE_SIZE);
  342. if(gns.clips.iScanSpeed < 0)
  343. CurrLocationBackup = dwCurrentAddress;
  344. else
  345. CurrLocationBackup = -1;
  346. // Invoke playback of the Decoder & Drive
  347. // NOTE: The order of invocation is important, and must not be changed!
  348. DEC_PlaybackCommand(DEC_PLAYBACK_CMD_REF_FRAME_ONLY, NULL);//jeanz_0319_2005 Reset right command
  349. //LX051703: Add AV Data mode for Play CD
  350. if (!PE_Clips_Playback_Sectors(DRVCF_CDSPEED_1X | DRVF_PLAY_CD_AV_DATA, dwCurrentAddress, dwPlaybackSize)) {
  351. dbg_printf(("WARNING: GenericClip_play() Failed [1]n"));
  352. return FALSE;
  353. }
  354. //cancel Trigger Bit notification
  355. PE_CD_CancelNotification(TriggerBit);
  356. // Engage the Error-Recovery mehcanism for I-Frame Display Miss
  357. //(g_pClipsNav->m_ErrorRecoveryInfo).uRetryCount= CLIPS_ERROR_RECOVERY_RETRY_COUNT;
  358. tr_printf(("Scanning-Speed: %d.n", gns.clips.iScanSpeed));
  359. }else{
  360. ClipMarker mClipMarker;
  361. UINT16 uTime;
  362. SET_COP_MASK(COP_ABREPEAT);
  363. // Stop Scanning
  364. gns.clips.iScanSpeed = 0;
  365. #ifndef SUPPORT_FLASH_CARD
  366. PE_CD_SetScan(FALSE, (i_pThis->m_pConstAttr)->m_eAudioSID, gns.clips.iScanSpeed);
  367. #endif
  368. gcs.pstate = PST_PLAY;
  369. //dwCurrentAddress = PE_CD_GetDecoderCurrentLocationLBN();
  370. dwCurrentAddress = PE_Clips_GetCurrLocation();
  371. uTime = (UINT16)( (i_pThis->m_cfiInfo.dwFileLocation)/DRIVE_CLOCK_RATE);
  372. PE_CD_AbortPlayback(TRUE);
  373. #ifdef SUPPORT_FLASH_CARD
  374. PE_CD_SetScan(FALSE, (i_pThis->m_pConstAttr)->m_eAudioSID, gns.clips.iScanSpeed);
  375. #endif
  376. PE_Clips_EnableClock(TRUE, TRUE, uTime);
  377. PE_Clips_SelectClock(eCT_Drive);
  378. // Set the Marker.
  379. mClipMarker.dwAddress = dwCurrentAddress;
  380. mClipMarker.uTime = 0;
  381. mClipMarker.uClipNumer = gns.clips.uCurrPlaylistItem;
  382. dbg_printf(("Resume from %lx, file start address is %lxn", mClipMarker.dwAddress, i_pThis->m_cfiInfo.dwFileLocation));
  383. //Resume play from the current location.
  384. (i_pThis->m_pConstAttr->m_vtable.m_pfPlay)(i_pThis, &mClipMarker, FALSE);
  385. }
  386.   return;
  387. }
  388. void MPEGClip_pause(Clip *i_pThis, BOOL bEnable)
  389. {
  390. dbg_printf(("GenericClip_pause(%d)n", bEnable));
  391. if (bEnable) {
  392. // Pause the Decoder
  393. //AngieHe_0909_2004:Cancel MPEG scan by another function.
  394. if ((PST_SCAN == gcs.pstate)||((PST_SLOW == gcs.pstate )&&(gns.clips.iSlowSpeed<0)))
  395. {
  396. MPEG_scan(i_pThis,0);
  397.                      //jeanz_0319_2005 Wait for DVP decoding.
  398. DEC_SetSID(DEC_SID_TYPE_AUDIO, NoAudio);//Mute audio.
  399. {
  400. UINT8  uPictureCnt;
  401. UINT16 uStatus2;
  402. UINT16 utry =  10000;
  403. // Extract the value of the Picture-Counter
  404. while (utry--)
  405. {
  406. uStatus2 = inport(I64_STATUS_2);
  407. uPictureCnt = (UINT8)((uStatus2 & (UINT16)DEC_LL_STATUS2_DEC_PIC_CNTR_MASK) >> DEC_LL_STATUS2_DEC_PIC_CNTR_SHIFT);
  408. if(uPictureCnt<2)
  409. usleep(100UL);
  410. else
  411. {
  412. printf("n****** Wait for the DVP to docoder the picture before pause.uPictureCnt = %d   utry = %dn",uPictureCnt,utry);
  413. break;
  414. }
  415. }
  416. if(!utry)
  417. printf("n Time out to wait for the DVP decoder one Picture!!!  n");
  418. }
  419. }
  420. DEC_PlaybackCommand(DEC_PLAYBACK_CMD_PAUSE, NULL);
  421. DEC_SetSID(DEC_SID_TYPE_AUDIO, (i_pThis->m_pConstAttr)->m_eAudioSID);//Set audio.
  422. }
  423. else {
  424. // Resume the Decoder
  425. DEC_PlaybackCommand(DEC_PLAYBACK_CMD_RESUME, NULL);
  426. }
  427. return;
  428. }
  429. #ifdef D_NO_CLIPS_AUTORUN
  430. extern BOOL g_in_full_stop;
  431. #endif
  432. #define SCR_RATE 90000L
  433. UINT16 MPEGClip_getTime(const Clip *i_pThis)
  434. {
  435. DWORD dwCurrPTS;
  436. UINT16 dwCurrentTime;
  437. static UINT16 dwBeUsedTime;
  438. #ifdef D_NO_CLIPS_AUTORUN
  439. if (g_in_full_stop)
  440. return 0;
  441. #endif
  442. if(PE_CD_GetDecoderCurrentLocationSCR(&dwCurrPTS))
  443. {
  444. dwCurrentTime = (UINT16)(dwCurrPTS/SCR_RATE);
  445. //angieh_0412_2004:In Fast Backword if the SCR is 0,don't update current time. 
  446. if( (gns.clips.iScanSpeed < 0 || gns.clips.iSlowSpeed < 0) && (dwCurrentTime == 0) )
  447. dwCurrentTime = dwBeUsedTime;
  448. dwBeUsedTime = dwCurrentTime;
  449. }
  450. else
  451. dwCurrentTime = dwBeUsedTime;
  452. return dwCurrentTime;
  453. }
  454. void MPEGClip_recordMarker(const Clip *i_pThis, ClipMarker *o_pMarker)
  455. {
  456. dbg_printf(("MPEGClip_recordMarker()n"));
  457. o_pMarker->dwAddress= PE_Clips_GetCurrLocation();
  458. o_pMarker->uTime= GenericClip_getTime(i_pThis);
  459. o_pMarker->uClipNumer = gns.clips.uCurrentClipNumber;
  460. return;
  461. }