Commit d9a0c08a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

picture: remove dysfunctional picture_IsReferenced()

Nowadays, multiple pictures might share the same buffers. Consequently
the reference count of a single picture may be one even though there
are other references to the same buffers through a different picture.

Luckily picture_IsReferenced() is only really used in one place in
stream output, and then it was only an optimization.
parent 2ca454a4
......@@ -158,14 +158,6 @@ VLC_API picture_t *picture_Hold( picture_t *p_picture );
*/
VLC_API void picture_Release( picture_t *p_picture );
/**
* This function will return true if you are not the only owner of the
* picture.
*
* It is only valid if it is created using picture_New.
*/
VLC_API bool picture_IsReferenced( picture_t *p_picture );
/**
* This function will copy all picture dynamic properties.
*/
......
......@@ -120,7 +120,6 @@ VdpStatus vlc_vdp_video_attach(vdp_t *vdp, VdpVideoSurface surface,
assert(pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_420
|| pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_422
|| pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_444);
assert(!picture_IsReferenced(pic));
assert(pic->context == NULL);
pic->context = &field->context;
return VDP_STATUS_OK;
......
......@@ -710,7 +710,7 @@ static void OutputFrame( sout_stream_t *p_stream, picture_t *p_pic, sout_stream_
/* Overlay subpicture */
if( p_subpic )
{
if( picture_IsReferenced( p_pic ) && filter_chain_IsEmpty( id->p_f_chain ) )
if( filter_chain_IsEmpty( id->p_f_chain ) )
{
/* We can't modify the picture, we need to duplicate it,
* in this point the picture is already p_encoder->fmt.in format*/
......
......@@ -298,7 +298,6 @@ picture_BlendSubpicture
picture_CopyPixels
picture_Hold
picture_Release
picture_IsReferenced
picture_CopyProperties
picture_Copy
picture_Export
......
......@@ -308,13 +308,6 @@ void picture_Release( picture_t *p_picture )
priv->gc.destroy( p_picture );
}
bool picture_IsReferenced( picture_t *p_picture )
{
picture_priv_t *priv = (picture_priv_t *)p_picture;
return atomic_load( &priv->gc.refs ) > 1;
}
/*****************************************************************************
*
*****************************************************************************/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment