MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / dv_callback

Function dv_callback

src/SB/Core/gc/iSnd.cpp:75–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73ARQRequest* last_ar;
74
75static void dv_callback(void* userdata)
76{
77 struct UNK_VOIDSTAR
78 {
79 U8 pad[0x14];
80 U32 stream;
81 };
82
83 UNK_VOIDSTAR* data = (UNK_VOIDSTAR*)userdata;
84
85 if (!soundInited)
86 {
87 return;
88 }
89
90 U32 stream = data->stream;
91 xSndVoiceInfo* info = &gSnd.voice[stream];
92 info->sndID = 0;
93 info->flags = 0;
94 if (stream < sizeof(streams) / sizeof(UNK_STREAM))
95 {
96 U32 idx = stream;
97 if (streams[idx].vinf.voice == NULL)
98 {
99 return;
100 }
101
102 DVDCancelAsync(&streams[idx].fileInfo.cb, NULL);
103 ARQRemoveRequest(&streams[idx].request);
104 AXSetVoiceState(streams[idx].vinf.voice, 0);
105 MIXReleaseChannel(streams[idx].vinf.voice);
106
107 streams[idx].vinf.voice = NULL;
108 streams[idx].vinf.flags = 0x40000;
109 streams[idx].vinf.aid = 0;
110 }
111 else
112 {
113 U32 idx = stream - sizeof(streams) / sizeof(UNK_STREAM);
114 if (voices[idx].voice == NULL)
115 {
116 return;
117 }
118 MIXReleaseChannel(voices[idx].voice);
119 AXSetVoiceState(voices[idx].voice, 0);
120
121 voices[idx].voice = NULL;
122 voices[idx].flags = 0;
123 voices[idx].aid = 0;
124 }
125}
126
127static void arq_callback(u32)
128{

Callers

nothing calls this directly

Calls 4

DVDCancelAsyncFunction · 0.85
ARQRemoveRequestFunction · 0.85
AXSetVoiceStateFunction · 0.85
MIXReleaseChannelFunction · 0.85

Tested by

no test coverage detected