Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ Linux (Ubuntu 12.x onward, Raspbian)
sudo apt-get update
sudo apt-get install gcc-4.8 g++-4.8

# set up gcc alternates; we need gcc4.8

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50

# install audio and UI dependencies
sudo apt-get install gtk+-3-dev libnotify-dev notify-osd libasound2-dev

Expand All @@ -48,9 +41,9 @@ DEBUG=1 make ubuntu // debug build
or
DEBUG=1 make raspbian // debug build
or
make ubuntu-install // build and install locally
sudo make ubuntu-install // build and install locally
or
make raspbian-install // build and install locally
sudo make raspbian-install // build and install locally

# generate a debian package for distribution
./GeneratePkg.pl --platform=raspbian --application=openhome-player --version=0.1.2.3
Expand Down
34 changes: 18 additions & 16 deletions Win32/IMFCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <chrono>

#define DBUG_F(...) \
Log::Print("[CodecIMF] [%llu] ", \
Log::Print("[%llu] [CodecIMF] ", \
std::chrono::high_resolution_clock::now().time_since_epoch().count()); \
Log::Print(__VA_ARGS__)
#else
Expand Down Expand Up @@ -90,7 +90,6 @@ class CodecIMF : public CodecBase
const TChar *iStreamFormat;
TBool iStreamStart;
TBool iStreamEnded;
TUint64 iByteTotal;

OHPlayerByteStream *iByteStream;
IMFSourceReader *iSourceReader;
Expand Down Expand Up @@ -190,7 +189,6 @@ CodecIMF::CodecIMF(IMimeTypeList& aMimeTypeList)
, iStreamFormat(NULL)
, iStreamStart(false)
, iStreamEnded(false)
, iByteTotal(0)
, iByteStream(NULL)
, iSourceReader(NULL)
{
Expand Down Expand Up @@ -292,7 +290,7 @@ TBool CodecIMF::VerifyStreamType(IMFSourceReader *aSourceReader)
{
HRESULT hr = S_OK;
IMFMediaType *mediaType = NULL;
TBool retVal = FALSE;
TBool retVal = false;

hr = aSourceReader->GetNativeMediaType(
(DWORD)MF_SOURCE_READER_FIRST_AUDIO_STREAM,
Expand Down Expand Up @@ -481,26 +479,27 @@ TBool CodecIMF::ConfigureAudioStream(IMFSourceReader *aSourceReader)
SafeRelease(&uncompressedAudioType);
SafeRelease(&partialType);

return FALSE;
return false;
}

TBool CodecIMF::Recognise(const EncodedStreamInfo& aStreamInfo)
{
HRESULT hr;
TBool retVal = false;

#ifdef _DEBUG
DBUG_F("Recognise\n");
#endif

if (aStreamInfo.RawPcm())
{
return false;
return retVal;
}

// Initialise the byte stream.
iByteStream = new OHPlayerByteStream(iController,
(BOOL *)&iStreamStart,
(BOOL *)&iStreamEnded);
(TBool *)&iStreamStart,
(TBool *)&iStreamEnded);

// Create the SourceReader
#ifdef _DEBUG
Expand Down Expand Up @@ -562,7 +561,7 @@ void CodecIMF::StreamInitialise()
// Remove the recognition cache and start operating on the actual stream.
if (iStreamFormat == kFmtMp3)
{
// Move the stream postition to that reached in Recognise().
// Move the stream position to that reached in Recognise().
iByteStream->DisableRecogCache(true);
}
else
Expand Down Expand Up @@ -758,22 +757,17 @@ void CodecIMF::Process()
NULL,
&sampleBuf);

if (FAILED(hr))
{
DBUG_F("ReadSample Failed\n");
}

if (iStreamStart)
{
DBUG_F("SourceReader ReadSample CodecStreamStart\n");
FlushPCM();

THROW(CodecStreamStart);
}

if (iStreamEnded)
{
DBUG_F("SourceReader ReadSample CodecStreamEnded\n");
FlushPCM();

THROW(CodecStreamEnded);
}

Expand All @@ -793,6 +787,14 @@ void CodecIMF::Process()
THROW(CodecStreamEnded);
}

if (FAILED(hr))
{
DBUG_F("ReadSample Failed\n");

DBUG_F("SourceReader ReadSample CatchAll\n");
THROW(CodecStreamEnded);
}

if (sampleBuf == NULL)
{
DBUG_F("No sample read\n");
Expand Down
Loading