MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / pull_once

Function pull_once

framework/WebAssemblyPlayer/WABitStreamDecoder.cpp:272–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270};
271
272static void pull_once()
273{
274 timerSetter timer;
275
276 if (status == status_idle) {
277 if (!pollData()) {
278 timer = 1000;
279 return;
280 }
281
282 int ret = decoder->prepare();
283
284 if (ret < 0) {
285 status = status_error;
286
287 if (errorCallBack) {
288 errorCallBack(ret);
289 }
290 } else {
291 status = status_prepared;
292 }
293 }
294
295 if (status == status_prepared) {
296 if (!readEos && decoder->getCacheDuration() < 1000000 * 10) {
297 int count = 0;
298
299 while (pollData()) {
300 decoder->readPacket();
301
302 if (count++ > 0) {
303 break;
304 }
305 }
306 }
307
308// if (decoder->getCacheDuration() == 0)
309// timer = 1000;
310 int count = 0;
311
312 while (pollRawBuffer == nullptr || pollRawBuffer(nullptr, 0) == 0) {
313 decoder->pull_once();
314
315 if (count++ > 0) {
316 break;
317 }
318 }
319 }
320}
321
322#ifdef __EMSCRIPTEN__
323

Callers 1

Calls 5

pollDataFunction · 0.85
getCacheDurationMethod · 0.80
pull_onceMethod · 0.80
prepareMethod · 0.65
readPacketMethod · 0.45

Tested by

no test coverage detected