* Fixed some coding style issues. David, please take a little more care about

this!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34408 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-12-01 13:04:21 +00:00
parent c1cb57b1b1
commit 2920b81793
1 changed files with 55 additions and 50 deletions

View File

@ -22,6 +22,8 @@
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <SupportDefs.h>
#include <math.h>
#include <stdio.h>
@ -39,7 +41,8 @@
OpenDMLIndex::OpenDMLIndex(BPositionIO *source, OpenDMLParser *parser)
: Index(source, parser)
:
Index(source, parser)
{
}
@ -62,14 +65,15 @@ OpenDMLIndex::Init()
int64 pos = 0;
uint32 bytesRead;
for (uint32 i=0; i < fStreamCount; i++) {
for (int32 i = 0; i < fStreamCount; i++) {
stream = fParser->StreamInfo(i);
pos = stream->odml_index_start;
bytesRead = sizeof(odml_index_header);
if ((int32)bytesRead != fSource->ReadAt(pos, &superIndex, bytesRead)) {
ERROR("libOpenDML: OpenDMLIndex::Init file reading failed to read superindex\n");
ERROR("libOpenDML: OpenDMLIndex::Init file reading failed to read "
"superindex\n");
return B_IO_ERROR;
}
@ -84,35 +88,34 @@ OpenDMLIndex::Init()
return B_OK;
}
status_t
OpenDMLIndex::ReadIndex(uint32 stream_index, int64 pos, uint32 *lastFrame, bigtime_t *pts, odml_index_header *superIndex) {
OpenDMLIndex::ReadIndex(uint32 stream_index, int64 pos, uint32 *lastFrame,
bigtime_t *pts, odml_index_header *superIndex)
{
odml_superindex_entry superIndexEntry;
//odml_field_index_entry fieldIndexEntry;
uint32 bytesRead;
const OpenDMLStream *stream = fParser->StreamInfo(stream_index);
for (uint32 i = 0; i < superIndex->entries_used; i++) {
if (superIndex->index_type == AVI_INDEX_OF_INDEXES) {
bytesRead = sizeof(odml_superindex_entry);
if ((int32)bytesRead != fSource->ReadAt(pos, &superIndexEntry, bytesRead)) {
ERROR("libOpenDML: OpenDMLIndex::Init file reading failed to read superindex entry\n");
ssize_t bytesRead = fSource->ReadAt(pos, &superIndexEntry,
sizeof(odml_superindex_entry));
if (bytesRead < 0)
return bytesRead;
if (bytesRead != (ssize_t)sizeof(odml_superindex_entry)) {
ERROR("libOpenDML: OpenDMLIndex::Init file reading failed to "
"read superindex entry\n");
return B_IO_ERROR;
}
pos += bytesRead;
if (superIndexEntry.start == 0) {
if (superIndexEntry.start == 0)
continue;
}
if (superIndex->index_sub_type == AVI_INDEX_2FIELD) {
} else {
ReadChunkIndex(stream_index, superIndexEntry.start + 8, lastFrame, pts, stream);
if (superIndex->index_sub_type != AVI_INDEX_2FIELD) {
ReadChunkIndex(stream_index, superIndexEntry.start + 8,
lastFrame, pts, stream);
}
}
}
@ -120,9 +123,11 @@ const OpenDMLStream *stream = fParser->StreamInfo(stream_index);
return B_OK;
}
status_t
OpenDMLIndex::ReadChunkIndex(uint32 stream_index, int64 pos, uint32 *lastFrame, bigtime_t *pts, const OpenDMLStream *stream) {
status_t
OpenDMLIndex::ReadChunkIndex(uint32 stream_index, int64 pos, uint32 *lastFrame,
bigtime_t *pts, const OpenDMLStream *stream)
{
odml_index_entry chunkIndexEntry;
odml_chunk_index_header chunkIndex;
uint32 bytesRead;