Media: Use assignment operators instead of memset.
Spotted by GCC 8 -Werror=class-memaccess.
This commit is contained in:
@@ -189,7 +189,7 @@ status_t OpenSoundDevice::get_media_format_description_for(int fmt, media_format
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
memset(&desc[i], 0, sizeof(media_format_description));
|
desc[i] = media_format_description();
|
||||||
if (count < 1)
|
if (count < 1)
|
||||||
return 0;
|
return 0;
|
||||||
if (fmt & AFMT_SUPPORTED_PCM) {
|
if (fmt & AFMT_SUPPORTED_PCM) {
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ OpenSoundNode::OpenSoundNode(BMediaAddOn* addon, const char* name,
|
|||||||
// initialize our preferred format object
|
// initialize our preferred format object
|
||||||
// TODO: this should go away! should use engine's preferred for each afmt.
|
// TODO: this should go away! should use engine's preferred for each afmt.
|
||||||
#if 1
|
#if 1
|
||||||
memset(&fPreferredFormat, 0, sizeof(fPreferredFormat));
|
fPreferredFormat = media_format();
|
||||||
// set everything to wildcard first
|
// set everything to wildcard first
|
||||||
fPreferredFormat.type = B_MEDIA_RAW_AUDIO;
|
fPreferredFormat.type = B_MEDIA_RAW_AUDIO;
|
||||||
fPreferredFormat.u.raw_audio = media_multi_audio_format::wildcard;
|
fPreferredFormat.u.raw_audio = media_multi_audio_format::wildcard;
|
||||||
|
|||||||
@@ -1027,7 +1027,7 @@ void TransportView::_updateTimeSource() {
|
|||||||
if(err < B_OK)
|
if(err < B_OK)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
memcpy(&itemNode, data, sizeof(media_node));
|
itemNode = *((media_node*)data);
|
||||||
if(itemNode != tsNode)
|
if(itemNode != tsNode)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -1149,7 +1149,7 @@ void TransportView::_timeSourceDeleted(
|
|||||||
if(err < B_OK)
|
if(err < B_OK)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
memcpy(&itemNode, data, sizeof(media_node));
|
itemNode = *((media_node*)data);
|
||||||
if(itemNode.node != id)
|
if(itemNode.node != id)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
@@ -465,7 +465,7 @@ LoggingConsumer::Disconnected(
|
|||||||
mLogger->Log(LOG_DISCONNECTED, logMsg);
|
mLogger->Log(LOG_DISCONNECTED, logMsg);
|
||||||
|
|
||||||
// wipe out our input record
|
// wipe out our input record
|
||||||
memset(&mInput, 0, sizeof(mInput));
|
mInput = media_input();
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
|
|||||||
@@ -432,7 +432,7 @@ AudioSettingsView::_FillChannelMenu(const dormant_node_info* nodeInfo)
|
|||||||
|
|
||||||
for (int32 i = 0; i < inputCount; i++) {
|
for (int32 i = 0; i < inputCount; i++) {
|
||||||
media_input* input = new media_input();
|
media_input* input = new media_input();
|
||||||
memcpy(input, &inputs[i], sizeof(*input));
|
*input = inputs[i];
|
||||||
ChannelMenuItem* channelItem = new ChannelMenuItem(input,
|
ChannelMenuItem* channelItem = new ChannelMenuItem(input,
|
||||||
new BMessage(message));
|
new BMessage(message));
|
||||||
fChannelMenu->AddItem(channelItem);
|
fChannelMenu->AddItem(channelItem);
|
||||||
|
|||||||
Reference in New Issue
Block a user