diff options
author | elupus <elupus@svn> | 2010-01-21 03:07:06 +0000 |
---|---|---|
committer | elupus <elupus@svn> | 2010-01-21 03:07:06 +0000 |
commit | 98f255c394095fa5e4976cb826889a43b5ea0c8e (patch) | |
tree | 48ae8280f4c5cd006b5095bf17069f91513dbb1a | |
parent | 03513d17b865454780f1a2a04e53f975132f3084 (diff) |
changed: no need to have a retry logic for creating vdpau surfaces
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@27042 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r-- | xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 33 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h | 1 |
2 files changed, 14 insertions, 20 deletions
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp index e50d1e34fb..85c2bd57fc 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp @@ -937,30 +937,25 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) } } - int tries = 0; VdpStatus vdp_st = VDP_STATUS_ERROR; if (render == NULL) { - while(vdp_st != VDP_STATUS_OK && tries < NUM_VIDEO_SURFACES_MAX_TRIES) + // create a new surface + VdpDecoderProfile profile; + ReadFormatOf(avctx->pix_fmt, profile, vdp->vdp_chroma_type); + render = (vdpau_render_state*)calloc(sizeof(vdpau_render_state), 1); + vdp_st = vdp->vdp_video_surface_create(vdp->vdp_device, + vdp->vdp_chroma_type, + avctx->width, + avctx->height, + &render->surface); + vdp->CheckStatus(vdp_st, __LINE__); + if (vdp_st != VDP_STATUS_OK) { - tries++; - CLog::Log(LOGNOTICE, " (VDPAU) Didnt find a Video Surface Available (Total: %i). Creating a new one. TRY #%i", - vdp->m_videoSurfaces.size(), tries); - // create a new surface - VdpDecoderProfile profile; - ReadFormatOf(avctx->pix_fmt, profile, vdp->vdp_chroma_type); - render = (vdpau_render_state*)calloc(sizeof(vdpau_render_state), 1); - vdp_st = vdp->vdp_video_surface_create(vdp->vdp_device, - vdp->vdp_chroma_type, - avctx->width, - avctx->height, - &render->surface); - vdp->CheckStatus(vdp_st, __LINE__); - if (vdp_st == VDP_STATUS_OK) - vdp->m_videoSurfaces.push_back(render); + free(render); + CLog::Log(LOGERROR, "CVDPAU::FFGetBuffer - No Video surface available could be created"); + return -1; } - if (vdp_st != VDP_STATUS_OK) - CLog::Log(LOGNOTICE, " (VDPAU) No Video surface available could be created.... continuing with an invalid handler"); } if (render == NULL) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h index 4f288e2afa..b32babf4c6 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h @@ -38,7 +38,6 @@ namespace Surface { class CSurface; } #define NUM_VIDEO_SURFACES_MPEG2 10 // (1 frame being decoded, 2 reference) #define NUM_VIDEO_SURFACES_H264 32 // (1 frame being decoded, up to 16 references) #define NUM_VIDEO_SURFACES_VC1 10 // (same as MPEG-2) -#define NUM_VIDEO_SURFACES_MAX_TRIES 100 #define NUM_OUTPUT_SURFACES_FOR_FULLHD 2 #define FULLHD_WIDTH 1920 |