summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schmirler <vdr@schmirler.de>2011-11-21 13:03:06 +0100
committerFrank Schmirler <vdr@schmirler.de>2011-11-21 13:03:06 +0100
commitce1583a756fe7d80522ed3e82275705b9cbe00b7 (patch)
treecf02bd72199445506a713e38adf6a65d0c00b2bd
parent20c931ac6d8cbc335f066bb406cdaf9490f10235 (diff)
downloadvdr-plugin-streamdev-ce1583a756fe7d80522ed3e82275705b9cbe00b7.tar.gz
vdr-plugin-streamdev-ce1583a756fe7d80522ed3e82275705b9cbe00b7.tar.bz2
Code cleanup and optimization (thanks to Ville Skyttä)
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY1
-rw-r--r--libdvbmpeg/remux.c25
-rw-r--r--libdvbmpeg/ringbuffy.c3
-rw-r--r--server/connection.c2
-rw-r--r--server/connectionHTTP.c2
6 files changed, 4 insertions, 30 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 507710b..f0e7c92 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -197,3 +197,4 @@ Ville Skyttä
for updating the outdated COPYING file and FSF address
for restricting VTP command RENR to liemikuutio patch < 1.32
for fixing memory and filedescriptor leaks in libdvbmpeg
+ for code cleanup and optimization
diff --git a/HISTORY b/HISTORY
index 5332b1b..e094cde 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,7 @@
VDR Plugin 'streamdev' Revision History
---------------------------------------
+- code cleanup and optimization (thanks to Ville Skyttä)
- properly shutdown IGMP timeout handler thread when the plugin is stopped.
Fixes occasional segfaults on VDR exit.
- fixed memory leak in libdvbmpeg read_pes (thanks to Ville Skyttä)
diff --git a/libdvbmpeg/remux.c b/libdvbmpeg/remux.c
index e4607db..b37de3a 100644
--- a/libdvbmpeg/remux.c
+++ b/libdvbmpeg/remux.c
@@ -388,10 +388,9 @@ int refill_buffy(Remux *rem)
while ( acount > MAX_PLENGTH && vcount > MAX_PLENGTH && count < 10){
- int neof;
count++;
init_pes(&pes);
- if ((neof = read_pes(fin,&pes)) <= 0) return -1;
+ if (read_pes(fin,&pes) <= 0) return -1;
switch(pes.stream_id){
case AUDIO_STREAM_S ... AUDIO_STREAM_E:
rem->apes++;
@@ -702,22 +701,6 @@ void init_remux(Remux *rem, int fin, int fout, int mult)
rem->time_off = 0;
}
-uint32_t bytes2pts(int bytes, int rate)
-{
- if (bytes < 0xFFFFFFFFUL/720000UL)
- return (uint32_t)(bytes*720000UL/rate);
- else
- return (uint32_t)(bytes/rate*720000UL);
-}
-
-long pts2bytes( uint32_t pts, int rate)
-{
- if (pts < 0xEFFFFFFFUL/rate)
- return (pts*rate/720000);
- else
- return (pts* (rate/720000));
-}
-
int write_audio_pes( Remux *rem, uint8_t *buf, int *alength)
{
int add;
@@ -1088,12 +1071,6 @@ struct remux_s{
} REMUX;
-void init_REMUX(REMUX *rem)
-{
- rem->num_pbuf = 0;
-}
-
-
#define REPACK 2048
#define ABUF_SIZE REPACK*1024
diff --git a/libdvbmpeg/ringbuffy.c b/libdvbmpeg/ringbuffy.c
index c8a67a3..76f1a96 100644
--- a/libdvbmpeg/ringbuffy.c
+++ b/libdvbmpeg/ringbuffy.c
@@ -192,9 +192,8 @@ int ring_read_file(ringbuffy *rbuf, int fd, int count)
}
int ring_rest(ringbuffy *rbuf){
- int diff, free, pos, rest;
+ int diff, free, pos;
pos = rbuf->read_pos;
- rest = rbuf->size - pos;
diff = rbuf->write_pos - pos;
free = (diff >= 0) ? diff : rbuf->size+diff;
diff --git a/server/connection.c b/server/connection.c
index a73470b..366eec5 100644
--- a/server/connection.c
+++ b/server/connection.c
@@ -281,7 +281,6 @@ cDevice* cServerConnection::CheckDevice(const cChannel *Channel, int Priority, b
return NULL; // no CAM is able to decrypt this channel
}
- bool NeedsDetachReceivers = false;
cDevice *d = NULL;
//cCamSlot *s = NULL;
@@ -335,7 +334,6 @@ cDevice* cServerConnection::CheckDevice(const cChannel *Channel, int Priority, b
// This device has less impact than any previous one, so we take it.
Impact = imp;
d = device;
- NeedsDetachReceivers = ndr;
}
}
}
diff --git a/server/connectionHTTP.c b/server/connectionHTTP.c
index ffcc924..161d5c7 100644
--- a/server/connectionHTTP.c
+++ b/server/connectionHTTP.c
@@ -228,8 +228,6 @@ bool cConnectionHTTP::ProcessRequest(void)
void cConnectionHTTP::Flushed(void)
{
- std::string line;
-
if (m_Status != hsBody)
return;