Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2010-04-09 18:12:59 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2010-04-09 18:12:59 +0400
commitefbc9d9043ff8ff92716ddd00a5f61412d535593 (patch)
tree8f3e621f756cf1f5b4d64d97964c7e7abd8aaf08 /src/filters/parser/MP4Splitter/Ap4AsyncReaderStream.cpp
parentdf6b139a6d9027156f614b68687e039e3a5854db (diff)
revert r1783
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1785 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser/MP4Splitter/Ap4AsyncReaderStream.cpp')
-rw-r--r--src/filters/parser/MP4Splitter/Ap4AsyncReaderStream.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/filters/parser/MP4Splitter/Ap4AsyncReaderStream.cpp b/src/filters/parser/MP4Splitter/Ap4AsyncReaderStream.cpp
index c77a070b0..2721e811d 100644
--- a/src/filters/parser/MP4Splitter/Ap4AsyncReaderStream.cpp
+++ b/src/filters/parser/MP4Splitter/Ap4AsyncReaderStream.cpp
@@ -1,54 +1,54 @@
#include "stdafx.h"
#include "Ap4AsyncReaderStream.h"
-AP4_AsyncReaderStream::AP4_AsyncReaderStream(CBaseSplitterFile* pFile)
- : m_refs(1)
- , m_pFile(pFile)
+AP4_AsyncReaderStream::AP4_AsyncReaderStream(CBaseSplitterFile* pFile)
+ : m_refs(1)
+ , m_pFile(pFile)
{
- ASSERT(pFile);
+ ASSERT(pFile);
}
AP4_AsyncReaderStream::~AP4_AsyncReaderStream()
{
- ASSERT(m_refs == 0);
+ ASSERT(m_refs == 0);
}
void AP4_AsyncReaderStream::AddReference()
{
- ASSERT(m_refs > 0);
- ++m_refs;
+ ASSERT(m_refs > 0);
+ ++m_refs;
}
void AP4_AsyncReaderStream::Release()
{
- ASSERT(m_refs > 0);
- if(--m_refs == 0) delete this;
+ ASSERT(m_refs > 0);
+ if(--m_refs == 0) delete this;
}
AP4_Result AP4_AsyncReaderStream::ReadPartial(void* buffer, AP4_Size bytesToRead, AP4_Size& bytesRead)
{
- AP4_Size bytesAvail = (AP4_Size)m_pFile->GetRemaining();
+ AP4_Size bytesAvail = (AP4_Size)m_pFile->GetRemaining();
- if(bytesAvail < bytesToRead)
- {
- bytesRead = bytesAvail;
- bytesToRead = bytesAvail;
- }
+ if(bytesAvail < bytesToRead)
+ {
+ bytesRead = bytesAvail;
+ bytesToRead = bytesAvail;
+ }
- if(bytesAvail == 0)
- {
- return AP4_ERROR_EOS;
- }
+ if(bytesAvail == 0)
+ {
+ return AP4_ERROR_EOS;
+ }
- if(FAILED(m_pFile->ByteRead((BYTE*)buffer, bytesToRead)))
- {
- bytesRead = 0;
- return AP4_ERROR_READ_FAILED;
- }
+ if(FAILED(m_pFile->ByteRead((BYTE*)buffer, bytesToRead)))
+ {
+ bytesRead = 0;
+ return AP4_ERROR_READ_FAILED;
+ }
- bytesRead = bytesToRead;
+ bytesRead = bytesToRead;
- return AP4_SUCCESS;
+ return AP4_SUCCESS;
}
AP4_Result AP4_AsyncReaderStream::WritePartial(const void* buffer, AP4_Size bytesToWrite, AP4_Size& bytesWritten)
@@ -58,18 +58,18 @@ AP4_Result AP4_AsyncReaderStream::WritePartial(const void* buffer, AP4_Size byte
AP4_Result AP4_AsyncReaderStream::Seek(AP4_Position offset)
{
- m_pFile->Seek(offset);
- return m_pFile->GetPos() == offset ? AP4_SUCCESS : AP4_FAILURE;
+ m_pFile->Seek(offset);
+ return m_pFile->GetPos() == offset ? AP4_SUCCESS : AP4_FAILURE;
}
AP4_Result AP4_AsyncReaderStream::Tell(AP4_Position& offset)
{
- offset = (AP4_Offset)m_pFile->GetPos();
- return AP4_SUCCESS;
+ offset = (AP4_Offset)m_pFile->GetPos();
+ return AP4_SUCCESS;
}
AP4_Result AP4_AsyncReaderStream::GetSize(AP4_LargeSize& size)
{
- size = m_pFile->GetLength();
- return AP4_SUCCESS;
+ size = m_pFile->GetLength();
+ return AP4_SUCCESS;
} \ No newline at end of file