git-svn-id: svn://elaine/murooma/trunk@222 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
(no author) 2014-08-30 20:48:43 +00:00
parent c6dbf53a16
commit 42f27c328d
10 changed files with 289 additions and 234 deletions

View file

@ -47,7 +47,7 @@ void Receiver::stop()
void Receiver::worker()
{
active_ = true;
PcmDecoder decoder;
OggDecoder decoder;
while (active_)
{
try
@ -64,12 +64,15 @@ void Receiver::worker()
{
WireChunk* wireChunk = new WireChunk();
socketRead(&s, wireChunk, Chunk::getHeaderSize());
//cout << "WireChunk length: " << wireChunk->length << ", sec: " << wireChunk->tv_sec << ", usec: " << wireChunk->tv_usec << "\n";
wireChunk->payload = (char*)malloc(wireChunk->length);
socketRead(&s, wireChunk->payload, wireChunk->length);
Chunk* chunk = new Chunk(stream_->format, wireChunk);
//cout << "WireChunk length: " << wireChunk->length << ", Duration: " << chunk->getDuration() << ", sec: " << wireChunk->tv_sec << ", usec: " << wireChunk->tv_usec/1000 << ", type: " << wireChunk->type << "\n";
if (decoder.decode(chunk))
{
//cout << "Duration: " << chunk->getDuration() << "\n";
stream_->addChunk(chunk);
}
}
}
catch (const std::exception& e)