triple: abuse dmx->getBuffer as 'dmx running' indicator

This commit is contained in:
Stefan Seyfried
2015-02-06 19:46:30 +01:00
parent 757f7de70c
commit 746fe7bf87

View File

@@ -77,6 +77,7 @@ typedef struct dmx_pdata {
int last_measure;
int last_data;
int devnum;
bool running;
} dmx_pdata;
#define P ((dmx_pdata *)pdata)
@@ -94,6 +95,7 @@ cDemux::cDemux(int n)
P->measure = false;
P->last_measure = 0;
P->last_data = 0;
P->running = false;
}
cDemux::~cDemux()
@@ -237,6 +239,7 @@ bool cDemux::Start(bool)
perror("DEMUX_START");
}
ioctl(fd, DEMUX_START);
P->running = true;
return true;
}
@@ -254,6 +257,7 @@ bool cDemux::Stop(void)
perror("DEMUX_STOP");
}
ioctl(fd, DEMUX_STOP);
P->running = false;
return true;
}
@@ -485,6 +489,7 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char * const filt
if (ioctl(fd, DEMUX_FILTER_SET, &s_flt) < 0)
return false;
P->running = true;
return true;
}
@@ -554,6 +559,8 @@ void cDemux::SetSyncMode(AVSYNC_TYPE /*mode*/)
void *cDemux::getBuffer()
{
lt_debug("%s #%d\n", __FUNCTION__, num);
if (P->running)
return (void *)1;
return NULL;
}