MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _packetin

Method _packetin

Engine/source/core/ogg/oggTheoraDecoder.cpp:217–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215//-----------------------------------------------------------------------------
216
217bool OggTheoraDecoder::_packetin( ogg_packet* packet )
218{
219 ogg_int64_t granulePos;
220
221 if( th_decode_packetin( mTheoraDecoder, packet, &granulePos ) != 0 )
222 return false;
223
224 // See if we should drop this frame.
225 //RDTODO: if we have fallen too far behind, start skipping pages
226
227 F32 granuleTime = th_granule_time( mTheoraDecoder, granulePos );
228 mCurrentFrameTime = granuleTime;
229 mCurrentFrameNumber ++;
230
231 bool dropThisFrame = false;
232 TimeSourceRef timeSource = mTimeSource;
233 if( timeSource )
234 {
235 F32 currentTick = F32( timeSource->getPosition() ) / 1000.f;
236
237 if( currentTick >= ( mCurrentFrameTime + mFrameDuration ) )
238 dropThisFrame = true;
239 }
240
241#ifdef DEBUG_SPEW
242 Platform::outputDebugString( "[OggTheoraDecoder] new frame %i at %f sec%s",
243 U32( th_granule_frame( mTheoraDecoder, granulePos ) ),
244 granuleTime,
245 dropThisFrame ? " !! DROPPED !!" : "" );
246#endif
247
248 return !dropThisFrame;
249}
250
251//-----------------------------------------------------------------------------
252

Callers

nothing calls this directly

Calls 5

th_decode_packetinFunction · 0.85
th_granule_timeFunction · 0.85
th_granule_frameFunction · 0.85
U32Enum · 0.50
getPositionMethod · 0.45

Tested by

no test coverage detected