[libdvdnav-devel] [PATCH 03/33] Deprecate ifoFree_VOBU_ADMAP()

Timothy Gu timothygu99 at gmail.com
Thu Jan 15 23:16:39 CET 2015


On Thu Jan 15 2015 at 12:45:58 PM <beandog at gentoo.org> wrote:

> From: Steve Dibb <steve.dibb at gmail.com>
>
> ---
>  src/dvdread/ifo_read.h |  8 +++++++-
>  src/ifo_read.c         | 12 ++++++------
>  2 files changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/src/dvdread/ifo_read.h b/src/dvdread/ifo_read.h
> index 97f4179..e9e5568 100644
> --- a/src/dvdread/ifo_read.h
> +++ b/src/dvdread/ifo_read.h
> @@ -219,10 +219,16 @@ void ifoFree_PGCI_UT(ifo_handle_t *);
>  void ifoFree_VTS_TMAPT(ifo_handle_t *);
>  void ifoFree_C_ADT(ifo_handle_t *);
>  void ifoFree_TITLE_C_ADT(ifo_handle_t *);
> -void ifoFree_VOBU_ADMAP(ifo_handle_t *);
>  void ifoFree_TITLE_VOBU_ADMAP(ifo_handle_t *);
>  void ifoFree_TXTDT_MGI(ifo_handle_t *);
>
> +/**
> + * Deprecated functions used internally for freeing parsed sections of
> + * the ifo_handle_t structure and the allocated substructures.  These
> + * perform no function -- use ifoFree() only.
> + */
>


> +void ifoFree_VOBU_ADMAP(ifo_handle_t *);
>

#if __GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 1
# define attribute_deprecated __attribute__((deprecated))
#else
# define attribute_deprecated
#endif
attribute_deprecated void ifoFree_VOBU_ADMAP(ifo_handle_t *);

The deprecated attribute will print a compiler warning on all client apps
using the function.

> +
>  #ifdef __cplusplus
>  };
>  #endif
> diff --git a/src/ifo_read.c b/src/ifo_read.c
> index ec6952f..1310911 100644
> --- a/src/ifo_read.c
> +++ b/src/ifo_read.c
> @@ -487,7 +487,11 @@ void ifoClose(ifo_handle_t *ifofile) {
>    if(!ifofile)
>      return;
>
> -  ifoFree_VOBU_ADMAP(ifofile);
> +  if(ifofile->menu_vobu_admap) {
> +    free(ifofile->menu_vobu_admap->vobu_start_sectors);
> +    free(ifofile->menu_vobu_admap);
> +  }
> +
>    ifoFree_TITLE_VOBU_ADMAP(ifofile);
>    ifoFree_C_ADT(ifofile);
>    ifoFree_TITLE_C_ADT(ifofile);
> @@ -1829,11 +1833,7 @@ static void ifoFree_VOBU_ADMAP_internal(vobu_admap_t
> *vobu_admap) {
>  }
>
>  void ifoFree_VOBU_ADMAP(ifo_handle_t *ifofile) {
> -  if(!ifofile)
> -    return;
> -
> -  ifoFree_VOBU_ADMAP_internal(ifofile->menu_vobu_admap);
> -  ifofile->menu_vobu_admap = NULL;
> +  return;
>

This return shouldn't be needed.

Timothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/libdvdnav-devel/attachments/20150115/d4637490/attachment-0001.html>


More information about the libdvdnav-devel mailing list