changeset 27269:21e634c01f9f

Move duplicate FF_INPUT_BUFFER_PADDING_SIZE handling into demuxer.h
author reimar
date Wed, 16 Jul 2008 16:18:25 +0000
parents d79f8b282b35
children 44ebd7860248
files libmpdemux/demux_asf.c libmpdemux/demux_real.c libmpdemux/demux_viv.c libmpdemux/demuxer.h libmpdemux/video.c
diffstat 5 files changed, 7 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_asf.c	Wed Jul 16 16:14:56 2008 +0000
+++ b/libmpdemux/demux_asf.c	Wed Jul 16 16:18:25 2008 +0000
@@ -79,13 +79,6 @@
   asf->vid_ext_frame_index=-1;
 }
 
-#ifdef USE_LIBAVCODEC
-#include "libavcodec/avcodec.h"
-#else
-#define FF_INPUT_BUFFER_PADDING_SIZE 8
-#endif
-
-
 static void demux_asf_append_to_packet(demux_packet_t* dp,unsigned char *data,int len,int offs)
 {
   if(dp->len!=offs && offs!=-1) mp_msg(MSGT_DEMUX,MSGL_V,"warning! fragment.len=%d BUT next fragment offset=%d  \n",dp->len,offs);
--- a/libmpdemux/demux_real.c	Wed Jul 16 16:14:56 2008 +0000
+++ b/libmpdemux/demux_real.c	Wed Jul 16 16:18:25 2008 +0000
@@ -33,12 +33,6 @@
 #include "demuxer.h"
 #include "stheader.h"
 
-#ifdef USE_LIBAVCODEC
-#include "libavcodec/avcodec.h"
-#else
-#define FF_INPUT_BUFFER_PADDING_SIZE 8
-#endif
-
 //#define mp_dbg(mod,lev, args... ) mp_msg_c((mod<<8)|lev, ## args )
 
 #define MKTAG(a, b, c, d) (a | (b << 8) | (c << 16) | (d << 24))
--- a/libmpdemux/demux_viv.c	Wed Jul 16 16:14:56 2008 +0000
+++ b/libmpdemux/demux_viv.c	Wed Jul 16 16:18:25 2008 +0000
@@ -14,12 +14,6 @@
 #include "demuxer.h"
 #include "stheader.h"
 
-#ifdef USE_LIBAVCODEC
-#include "libavcodec/avcodec.h"
-#else
-#define FF_INPUT_BUFFER_PADDING_SIZE 8
-#endif
-
 /* parameters ! */
 int vivo_param_version = -1;
 char *vivo_param_acodec = NULL;
--- a/libmpdemux/demuxer.h	Wed Jul 16 16:14:56 2008 +0000
+++ b/libmpdemux/demuxer.h	Wed Jul 16 16:18:25 2008 +0000
@@ -93,6 +93,12 @@
 #define SEEK_ABSOLUTE (1 << 0)
 #define SEEK_FACTOR   (1 << 1)
 
+#ifdef USE_LIBAVCODEC
+#include "libavcodec/avcodec.h"
+#else
+#define FF_INPUT_BUFFER_PADDING_SIZE 8
+#endif
+
 // Holds one packet/frame/whatever
 typedef struct demux_packet_st {
   int len;
@@ -243,7 +249,7 @@
   dp->refcount=1;
   dp->master=NULL;
   dp->buffer=NULL;
-  if (len > 0 && (dp->buffer = (unsigned char *)malloc(len + 8)))
+  if (len > 0 && (dp->buffer = (unsigned char *)malloc(len + FF_INPUT_BUFFER_PADDING_SIZE)))
     memset(dp->buffer + len, 0, 8);
   else
     dp->len = 0;
--- a/libmpdemux/video.c	Wed Jul 16 16:14:56 2008 +0000
+++ b/libmpdemux/video.c	Wed Jul 16 16:18:25 2008 +0000
@@ -22,12 +22,6 @@
 /* sub_cc (closed captions)*/
 #include "sub_cc.h"
 
-#ifdef USE_LIBAVCODEC
-#include "libavcodec/avcodec.h"
-#else
-#define FF_INPUT_BUFFER_PADDING_SIZE 8
-#endif
-
 /* biCompression constant */
 #define BI_RGB        0L