mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 19:16:51 +02:00
- fixed wrong remux usage
This commit is contained in:
parent
1447427bdf
commit
32c1bf7c8b
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: streamer.c,v 1.11 2005/04/27 19:43:09 lordjaxom Exp $
|
* $Id: streamer.c,v 1.12 2005/04/30 14:59:56 lordjaxom Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <vdr/ringbuffer.h>
|
#include <vdr/ringbuffer.h>
|
||||||
@ -36,10 +36,14 @@ void cStreamdevWriter::Action(void)
|
|||||||
cTBSelect sel;
|
cTBSelect sel;
|
||||||
Dprintf("Writer start\n");
|
Dprintf("Writer start\n");
|
||||||
int max = 0;
|
int max = 0;
|
||||||
|
uchar *block = NULL;
|
||||||
|
int count, offset = 0;
|
||||||
m_Active = true;
|
m_Active = true;
|
||||||
while (m_Active) {
|
while (m_Active) {
|
||||||
int count;
|
if (block == NULL) {
|
||||||
uchar *block = m_Streamer->Get(count);
|
block = m_Streamer->Get(count);
|
||||||
|
offset = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (block) {
|
if (block) {
|
||||||
sel.Clear();
|
sel.Clear();
|
||||||
@ -51,13 +55,18 @@ void cStreamdevWriter::Action(void)
|
|||||||
|
|
||||||
if (sel.CanWrite(*m_Socket)) {
|
if (sel.CanWrite(*m_Socket)) {
|
||||||
int written;
|
int written;
|
||||||
if ((written = m_Socket->Write(block, count)) == -1) {
|
if ((written = m_Socket->Write(block + offset, count)) == -1) {
|
||||||
esyslog("ERROR: streamdev-server: couldn't send data: %m");
|
esyslog("ERROR: streamdev-server: couldn't send data: %m");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (count > max)
|
if (count > max)
|
||||||
max = count;
|
max = count;
|
||||||
|
|
||||||
|
offset += written;
|
||||||
|
count -= written;
|
||||||
m_Streamer->Del(written);
|
m_Streamer->Del(written);
|
||||||
|
if (count == 0)
|
||||||
|
block = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user