summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroskwon <kos@dev3>2014-06-25 12:09:49 (GMT)
committeroskwon <kos@dev3>2014-06-25 12:09:49 (GMT)
commit6c579a699134631f568f3b6a2edec2c69ddb4599 (patch)
treef11e09ed02e01dce90dc7c3333c29b2f7ebfa73a
parentb623b15cc8748385041804644384a9cd19e967d3 (diff)
Fix some mistake.
-rw-r--r--src/Demuxer.cpp6
-rw-r--r--src/Encoder.cpp1
-rw-r--r--src/Makefile2
-rw-r--r--src/SharedMemory.h16
-rw-r--r--src/Util.cpp2
5 files changed, 21 insertions, 6 deletions
diff --git a/src/Demuxer.cpp b/src/Demuxer.cpp
index fbe5b49..83290c6 100644
--- a/src/Demuxer.cpp
+++ b/src/Demuxer.cpp
@@ -94,9 +94,11 @@ void Demuxer::set_filter(std::vector<unsigned long> &new_pids) throw(trap)
throw(trap("demux filter setting failed."));
DEBUG("demux filter setting ok.");
- for(int i = 0; i < new_pids.size(); ++i) {
+ for(int i = 1; i < new_pids.size(); ++i) {
uint16_t pid = new_pids[i];
-
+ if (pid == 0) {
+ continue;
+ }
if(already_exist(pids, pid))
continue;
LOG("demux add pid (%x).", pid);
diff --git a/src/Encoder.cpp b/src/Encoder.cpp
index d6f817f..c9d09f2 100644
--- a/src/Encoder.cpp
+++ b/src/Encoder.cpp
@@ -79,6 +79,7 @@ Encoder::Encoder() throw(trap)
Encoder::~Encoder()
{
+ Post();
if (fd != -1) {
if (state == ENCODER_STAT_STARTED) {
DEBUG("stop transcoding..");
diff --git a/src/Makefile b/src/Makefile
index 9b6cd84..370aa1a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -50,7 +50,7 @@ install:
@$(UPLOAD) $(IP) . $(PROJECT) /usr/bin
clean:
- $(RM) $(PROJECT) $(OBJS) *.log
+ $(RM) $(PROJECT) $(OBJS) *.log *.o
.showinfo:
@echo "-----------------------------------------------------"
diff --git a/src/SharedMemory.h b/src/SharedMemory.h
index 88c1d02..de02b24 100644
--- a/src/SharedMemory.h
+++ b/src/SharedMemory.h
@@ -15,6 +15,8 @@
#include <semaphore.h>
#include <sys/mman.h>
+#include "Logger.h"
+
using namespace std;
//-------------------------------------------------------------------------------
@@ -66,8 +68,18 @@ protected:
return true;
}
- void Wait() { sem_wait(mSemId); }
- void Post() { sem_post(mSemId); }
+ void Wait()
+ {
+ DEBUG("WAIT-BEFORE");
+ sem_wait(mSemId);
+ DEBUG("WAIT-AFTER");
+ }
+ void Post()
+ {
+ DEBUG("POST-BEFORE");
+ sem_post(mSemId);
+ DEBUG("POST-AFTER");
+ }
public:
~SharedMemory()
diff --git a/src/Util.cpp b/src/Util.cpp
index 0473d08..639cdfb 100644
--- a/src/Util.cpp
+++ b/src/Util.cpp
@@ -140,6 +140,6 @@ void Util::kill_process(int pid)
{
int result = kill(pid, SIGINT);
DEBUG("SEND SIGINT to %d, result : %d", pid, result);
- sleep(1);
+ //sleep(1);
}
//----------------------------------------------------------------------