mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-17 02:56:16 +02:00
player, receiver
git-svn-id: svn://elaine/murooma/trunk@208 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
746933a96a
commit
10323c0485
12 changed files with 307 additions and 309 deletions
|
@ -4,13 +4,14 @@
|
|||
#include "common/log.h"
|
||||
|
||||
|
||||
Chunk::Chunk(const SampleFormat& sampleFormat, WireChunk* _wireChunk) : wireChunk(_wireChunk), format(format_), format_(sampleFormat), idx(0)
|
||||
Chunk::Chunk(const SampleFormat& sampleFormat, WireChunk* _wireChunk) : wireChunk(_wireChunk), format(sampleFormat), idx(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Chunk::Chunk(const SampleFormat& sampleFormat, size_t ms) : format(format_), format_(sampleFormat), idx(0)
|
||||
Chunk::Chunk(const SampleFormat& sampleFormat, size_t ms) : format(sampleFormat), idx(0)
|
||||
{
|
||||
// format = sampleFormat;
|
||||
wireChunk = new WireChunk;
|
||||
wireChunk->length = format.rate*format.frameSize*ms / 1000;
|
||||
wireChunk->payload = (char*)malloc(wireChunk->length);
|
||||
|
@ -33,6 +34,7 @@ bool Chunk::isEndOfChunk() const
|
|||
|
||||
double Chunk::getDuration() const
|
||||
{
|
||||
// std::cout << wireChunk->length << "\t" << format.frameSize << "\t" << (wireChunk->length / format.frameSize) << "\t" << ((double)format.rate / 1000.) << "\n";
|
||||
return (wireChunk->length / format.frameSize) / ((double)format.rate / 1000.);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue