correct initialization of media_format. (btw I just realized I never need to manually zero a format after construction) perform a complete copy of media_format. do some things related to handling meta_data_areas. still some left to do, so do an UNIMPLEMENTED if we are in that state
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6210 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -649,6 +649,9 @@ media_format::MetaDataSize() const
|
|||||||
media_format::media_format()
|
media_format::media_format()
|
||||||
{
|
{
|
||||||
memset(this, 0x00, sizeof(*this));
|
memset(this, 0x00, sizeof(*this));
|
||||||
|
meta_data_area = B_BAD_VALUE;
|
||||||
|
use_area = B_BAD_VALUE;
|
||||||
|
team = B_BAD_VALUE;
|
||||||
//meta_data, meta_data_size, meta_data_area, use_area,
|
//meta_data, meta_data_size, meta_data_area, use_area,
|
||||||
//team, and thisPtr are currently only used by decoders
|
//team, and thisPtr are currently only used by decoders
|
||||||
//when communicating with the file reader; they're not
|
//when communicating with the file reader; they're not
|
||||||
@@ -674,17 +677,24 @@ media_format::~media_format()
|
|||||||
media_format &
|
media_format &
|
||||||
media_format::operator=(const media_format &clone)
|
media_format::operator=(const media_format &clone)
|
||||||
{
|
{
|
||||||
memset(this, 0x00, sizeof(*this));
|
memcpy(this, &clone, sizeof(*this));
|
||||||
|
// these things only happen when a meta_data_area is defined:
|
||||||
type = clone.type;
|
if (meta_data_area != B_BAD_VALUE) {
|
||||||
user_data_type = clone.user_data_type;
|
thread_id thread = find_thread(NULL);
|
||||||
|
if (thread != B_NAME_NOT_FOUND) {
|
||||||
memcpy(user_data, clone.user_data, sizeof(media_format::user_data));
|
thread_info info;
|
||||||
|
if (get_thread_info(thread,&info) == B_OK) {
|
||||||
require_flags = clone.require_flags;
|
team = info.team;
|
||||||
deny_flags = clone.deny_flags;
|
}
|
||||||
|
}
|
||||||
memcpy(u._reserved_, clone.u._reserved_, sizeof(media_format::u._reserved_));
|
thisPtr = this;
|
||||||
|
// TODO: start _Media_Roster_
|
||||||
|
// TODO: request the _Media_Roster_ to give us the
|
||||||
|
// use_area for this team, or to create a
|
||||||
|
// clone for our team if our team doesn't have one yet
|
||||||
|
// TODO: set meta_data to point to the clone's address
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user