[FFmpeg-devel] [RFC] disentangling libavutil headers

Aurelien Jacobs aurel
Fri Jan 23 23:33:19 CET 2009


Diego Biurrun wrote:

> Here is (part of) a patch to disentangle libavutil headers.
> It gets rid of the circular dependency/inclusion between mem.h and
> internal.h.  As a bonus we can get rid of a bit of ugliness in
> mem.c.
> 
> I did not send along the changes outside libavutil.  As you can
> imagine they're not too exciting, just adding #includes for mem.h
> in lots of places.

>From my reading of this patch, it looks like no change is needed
outside libavutil.

> Index: libavutil/mathematics.c
> ===================================================================
> --- libavutil/mathematics.c	(revision 16729)
> +++ libavutil/mathematics.c	(working copy)
> @@ -23,6 +23,7 @@
>   * Miscellaneous math routines and tables.
>   */
>  
> +#include <assert.h>
>  #include "common.h"
>  #include "mathematics.h"

Unrelated, so should probably be applied separately.
Anyway, it looks OK.

> Index: libavutil/tree.c
> ===================================================================
> --- libavutil/tree.c	(revision 16729)
> +++ libavutil/tree.c	(working copy)
> @@ -18,8 +18,8 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
>  
> -#include "common.h"
>  #include "log.h"
> +#include "mem.h"
>  #include "tree.h"

All the similar changes are probably OK and could be applied
independently.

> Index: libavutil/lzo.c
> ===================================================================
> --- libavutil/lzo.c	(revision 16729)
> +++ libavutil/lzo.c	(working copy)
> @@ -18,7 +18,9 @@
>   * License along with FFmpeg; if not, write to the Free Software
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>   */
> +

Unrelated cosmetic.

>  #include "common.h"
> +#include "mem.h"

Shouldn't be needed.

> Index: libavutil/rational.c
> ===================================================================
> --- libavutil/rational.c	(revision 16729)
> +++ libavutil/rational.c	(working copy)
> @@ -25,6 +25,7 @@
>   * @author Michael Niedermayer <michaelni at gmx.at>
>   */
>  
> +#include <assert.h>
>  //#include <math.h>
>  #include <limits.h>

Same as above.

> Index: libavutil/internal.h
> ===================================================================
> --- libavutil/internal.h	(revision 16729)
> +++ libavutil/internal.h	(working copy)
> @@ -33,7 +33,8 @@
>  #include <stdint.h>
>  #include <stddef.h>
>  #include <assert.h>
>  #include "common.h"
> +#include "mem.h"
>  #include "timer.h"

Shouldn't be needed.

Aurel




More information about the ffmpeg-devel mailing list