diff --git a/Player/PlayerView.cpp b/Player/PlayerView.cpp index f282eb3..f4aa930 100644 --- a/Player/PlayerView.cpp +++ b/Player/PlayerView.cpp @@ -1269,7 +1269,9 @@ void CPlayerView::updateFrame() if (data.surface) { - std::swap(m_pMainStream.p, *data.surface); + IDirect3DSurface9* temp = m_pMainStream; + m_pMainStream = *data.surface; + *data.surface = temp; } else { diff --git a/video/ffmpeg_dxva2.cpp b/video/ffmpeg_dxva2.cpp index 9c87de4..5049626 100644 --- a/video/ffmpeg_dxva2.cpp +++ b/video/ffmpeg_dxva2.cpp @@ -324,10 +324,9 @@ static void dxva2_destroy_decoder(AVCodecContext *s) { InputStream *ist = (InputStream *)s->opaque; DXVA2Context *ctx = (DXVA2Context *)ist->hwaccel_ctx; - int i; if (ctx->surfaces) { - for (i = 0; i < ctx->num_surfaces; i++) { + for (int i = 0; i < ctx->num_surfaces; i++) { if (ctx->surfaces[i]) IDirect3DSurface9_Release(ctx->surfaces[i]); } @@ -338,7 +337,6 @@ static void dxva2_destroy_decoder(AVCodecContext *s) ctx->surface_age = 0; if (ctx->decoder) { - //IDirectXVideoDecoder_Release(ctx->decoder); ctx->decoder->Release(); ctx->decoder = NULL; }