Commit 7a58421b authored by Ghislain MARY's avatar Ghislain MARY

Really fix compilation with PCAP.

parent 07779d3e
......@@ -717,13 +717,6 @@ fi
AC_PATH_PROG(PCAP,pcap-config,false)
AM_CONDITIONAL(HAVE_PCAP, test $PCAP != false)
if test $PCAP != false ; then
PCAP_LIBS=`pcap-config --libs`
PCAP_CFLAGS=`pcap-config --cflags`
PCAP_CFLAGS="$PCAP_CFLAGS -DHAVE_PCAP"
AC_SUBST(PCAP_LIBS)
AC_SUBST(PCAP_CFLAGS)
fi
AC_ARG_ENABLE(pcap,
[AS_HELP_STRING([--enable-pcap], [Enable pcap library (default=no)])],
[case "${enableval}" in
......@@ -733,7 +726,13 @@ AC_ARG_ENABLE(pcap,
esac], [enable_pcap=no])
AM_CONDITIONAL(ENABLE_PCAP, test x$enable_pcap = xyes)
if test x$enable_pcap == xyes ; then
PCAP_CFLAGS="$PCAP_CFLAGS -DENABLE_PCAP"
if test $PCAP != false ; then
PCAP_LIBS=`pcap-config --libs`
PCAP_CFLAGS=`pcap-config --cflags`
PCAP_CFLAGS="$PCAP_CFLAGS -DHAVE_PCAP"
AC_SUBST(PCAP_LIBS)
AC_SUBST(PCAP_CFLAGS)
fi
fi
......
......@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mediastreamer2/waveheader.h"
#include "mediastreamer2/msticker.h"
#if defined(HAVE_PCAP) && defined(ENABLE_PCAP)
#ifdef HAVE_PCAP
#include <pcap/pcap.h>
#endif
......@@ -44,7 +44,7 @@ struct _PlayerData{
int samplesize;
uint32_t ts;
bool_t swap;
#if defined(HAVE_PCAP) && defined(ENABLE_PCAP)
#ifdef HAVE_PCAP
pcap_t *pcap;
struct pcap_pkthdr *pcap_hdr;
const u_char *pcap_data;
......@@ -69,7 +69,7 @@ static void player_init(MSFilter *f){
d->pause_time=0;
d->count=0;
d->ts=0;
#if defined(HAVE_PCAP) && defined(ENABLE_PCAP)
#ifdef HAVE_PCAP
d->pcap = NULL;
d->pcap_hdr = NULL;
d->pcap_data = NULL;
......@@ -166,7 +166,7 @@ static int player_open(MSFilter *f, void *arg){
d->state=MSPlayerPaused;
d->fd=fd;
d->ts=0;
#if defined(HAVE_PCAP) && defined(ENABLE_PCAP)
#ifdef HAVE_PCAP
d->pcap = NULL;
d->pcap_started = FALSE;
if (strstr(file, ".pcap")) {
......@@ -217,7 +217,7 @@ static int player_pause(MSFilter *f, void *arg){
static int player_close(MSFilter *f, void *arg){
PlayerData *d=(PlayerData*)f->data;
player_stop(f,NULL);
#if defined(HAVE_PCAP) && defined(ENABLE_PCAP)
#ifdef HAVE_PCAP
if (d->pcap) pcap_close(d->pcap);
#endif
if (d->fd>=0) close(d->fd);
......@@ -265,7 +265,7 @@ static void player_process(MSFilter *f){
d->count++;
ms_filter_lock(f);
if (d->state==MSPlayerPlaying){
#if defined(HAVE_PCAP) && defined(ENABLE_PCAP)
#ifdef HAVE_PCAP
if (d->pcap) {
int res;
bool_t cont = TRUE;
......
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