std::vector<void*> crashes gcc 991026, so I switched to a vector of stream serialno, and use the stream serialno through the serial->OggStream* map to get back the OggStream * cookie for AllocateCookie. (whew!) casting the pointer to int probably would work too but this solution seems less hackish.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6308 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -136,7 +136,7 @@ retry:
|
||||
}
|
||||
};
|
||||
fStreams[serialno] = OggStream::makeOggStream(new Interface(this, serialno), serialno, packet);
|
||||
fCookies.push_back(fStreams[serialno]);
|
||||
fCookies.push_back(serialno);
|
||||
}
|
||||
return fStreams[serialno]->AddPage(position,page);
|
||||
}
|
||||
@@ -292,7 +292,7 @@ OggReader::AllocateCookie(int32 streamNumber, void **cookie)
|
||||
TRACE("OggReader::AllocateCookie: invalid streamNumber: bail\n");
|
||||
return B_ERROR;
|
||||
}
|
||||
OggStream * stream = fCookies[streamNumber];
|
||||
OggStream * stream = fStreams[fCookies[streamNumber]];
|
||||
// store the cookie
|
||||
*cookie = stream;
|
||||
return B_OK;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace BPrivate { namespace media {
|
||||
class OggStream;
|
||||
|
||||
typedef std::map<long,OggStream*> serialno_OggStream_map;
|
||||
typedef std::vector<OggStream*> OggStream_vector;
|
||||
typedef std::vector<long> serialno_vector;
|
||||
|
||||
class OggReader : public Reader
|
||||
{
|
||||
@@ -47,7 +47,7 @@ protected:
|
||||
|
||||
ogg_sync_state fSync;
|
||||
serialno_OggStream_map fStreams;
|
||||
OggStream_vector fCookies;
|
||||
serialno_vector fCookies;
|
||||
BPositionIO * fSeekable;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user