用MediaPosition.put_Rate(Rate);好象只改变频率,播放速度没变,

解决方案 »

  1.   

    bool UpdateStreamSample(IDirectDrawStreamSample* lpddss) {    HRESULT hr;    // Update the sample only if the application is active
        if (!g_bActive) {
            return true;
        }    // If we are seeking, update the stream clock
        if (g_stOffset) {
            g_stTime += g_stOffset;
            g_lpmmsStream->Seek(g_stTime);
        }#ifdef RENDER_TO_DEVICE_MEMORY
        // Make sure the flip has completed before changing texture contents or
        // we risk a render timeout
        do {
            hr = g_lpddsFront->GetFlipStatus(DDGFS_ISFLIPDONE);
        } while (hr == DDERR_WASSTILLDRAWING);    if (ResultFailed(hr, TEXT("IDirectDrawSurface::GetFlipStatus"))) {
            return false;
        }
    #endif // RENDER_TO_DEVICE_MEMORY    // Update the texture with the contents of the video stream
        hr = lpddss->Update(0, NULL, NULL, 0);
        if (hr != MS_E_NOTRUNNING && FAILED(hr)) {
            ResultFailed(hr, TEXT("IDirectDrawStreamSample::Update"));
           return false;
        }    // If we've reached the end of the stream, reset it
        if (hr == MS_S_ENDOFSTREAM) {
          if (WaitForSingleObject(g_hEOS, 0) == WAIT_OBJECT_0)
          {
             hr = g_lpmmsStream->Seek(0);
             if (ResultFailed(hr, TEXT("IMultiMediaStream::Seek"))) {
                return false;
             }
          }        hr = lpddss->Update(0, NULL, NULL, 0);
            if (hr != MS_E_NOTRUNNING && FAILED(hr)) {
                ResultFailed(hr, TEXT("IDirectDrawStreamSample::Update"));
               return false;
            }
        }#ifndef RENDER_TO_DEVICE_MEMORY    if (g_lpddsStreamTarget && g_bStretchStream) {
            hr = g_lpddsSystemMemory->Blt(&g_rectTexture, g_lpddsStreamTarget, 
                                          &g_rectStream, DDBLT_WAIT, NULL);
            if (ResultFailed(hr, TEXT("IDirectDrawSurface::Blt"))) {
                return false;
            }
        }    // Load the source texture into the destination
        hr = g_lpd3dtDeviceMemory->Load(g_lpd3dtSystemMemory);
        if (FAILED(hr)) {
            if (hr != DDERR_SURFACELOST) {
                ResultFailed(hr, TEXT("IDirect3DTexture2::Load"));
                return false;
            }
        }#endif // !RENDER_TO_DEVICE_MEMORY    return true;}
      

  2.   

    Private m_objMediaPosition As IMediaPosition m_objMediaPosition.Rate=0.5~2应该有效果吧!