Skip to content

Commit

Permalink
reference counting related bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
aliakseis committed Aug 21, 2019
1 parent 9c3afae commit 4cac93a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Player/PlayerView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 1 addition & 3 deletions video/ffmpeg_dxva2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 4cac93a

Please # to comment.