mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-18 11:36:14 +02:00
ogg
git-svn-id: svn://elaine/murooma/trunk@222 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
c6dbf53a16
commit
42f27c328d
10 changed files with 289 additions and 234 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue