X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_access.h;h=04a30b0e63ac555cfa963ca0969feb4808ca985c;hb=aeb72005975cfc84cfca6c3d660cdf0b84d54efb;hp=103badbb0362acfe2885f4af01634fa7a2bca47e;hpb=6d4bc50f38f446d21a9d8eabf983e7b6584d9474;p=vlc diff --git a/include/vlc_access.h b/include/vlc_access.h index 103badbb03..04a30b0e63 100644 --- a/include/vlc_access.h +++ b/include/vlc_access.h @@ -151,25 +151,31 @@ static inline void access_InitFields( access_t *p_a ) * This function will return the parent input of this access. * It is retained. It can return NULL. */ -VLC_EXPORT( input_thread_t *, access_GetParentInput, ( access_t *p_access ) ); - -#define ACCESS_SET_CALLBACKS( read, block, control, seek ) \ - p_access->pf_read = read; \ - p_access->pf_block = block; \ - p_access->pf_control = control; \ - p_access->pf_seek = seek; - -#define STANDARD_READ_ACCESS_INIT \ - access_InitFields( p_access ); \ - ACCESS_SET_CALLBACKS( Read, NULL, Control, Seek ); \ - p_sys = p_access->p_sys = calloc( 1, sizeof( access_sys_t )); \ - if( !p_sys ) return VLC_ENOMEM; - -#define STANDARD_BLOCK_ACCESS_INIT \ - access_InitFields( p_access ); \ - ACCESS_SET_CALLBACKS( NULL, Block, Control, Seek ); \ - p_sys = p_access->p_sys = calloc( 1, sizeof( access_sys_t ) ); \ - if( !p_sys ) return VLC_ENOMEM; +VLC_API input_thread_t * access_GetParentInput( access_t *p_access ) VLC_USED; + +#define ACCESS_SET_CALLBACKS( read, block, control, seek ) \ + do { \ + p_access->pf_read = (read); \ + p_access->pf_block = (block); \ + p_access->pf_control = (control); \ + p_access->pf_seek = (seek); \ + } while(0) + +#define STANDARD_READ_ACCESS_INIT \ + do { \ + access_InitFields( p_access ); \ + ACCESS_SET_CALLBACKS( Read, NULL, Control, Seek ); \ + p_sys = p_access->p_sys = calloc( 1, sizeof( access_sys_t ) ); \ + if( !p_sys ) return VLC_ENOMEM;\ + } while(0); + +#define STANDARD_BLOCK_ACCESS_INIT \ + do { \ + access_InitFields( p_access ); \ + ACCESS_SET_CALLBACKS( NULL, Block, Control, Seek ); \ + p_sys = p_access->p_sys = calloc( 1, sizeof( access_sys_t ) ); \ + if( !p_sys ) return VLC_ENOMEM; \ + } while(0); /** * @}