MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Player_Seek

Method Player_Seek

Source/Engine/Video/Android/VideoBackendAndroid.cpp:538–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536}
537
538void VideoBackendAndroid::Player_Seek(VideoBackendPlayer& player, TimeSpan time)
539{
540 PROFILE_CPU();
541 auto& playerAndroid = player.GetBackendState<VideoPlayerAndroid>();
542 player.VideoFrameDuration = player.AudioBufferDuration = TimeSpan::Zero();
543 media_status_t status = AMediaExtractor_seekTo(playerAndroid.Extractor, time.Ticks / 10, AMEDIAEXTRACTOR_SEEK_PREVIOUS_SYNC);
544 if (status != AMEDIA_OK)
545 {
546 VIDEO_API_ANDROID_ERROR(AMediaExtractor_seekTo, status);
547 }
548 if (playerAndroid.VideoCodec)
549 AMediaCodec_flush(playerAndroid.VideoCodec);
550 if (playerAndroid.AudioCodec)
551 AMediaCodec_flush(playerAndroid.AudioCodec);
552 player.StopAudio();
553}
554
555TimeSpan VideoBackendAndroid::Player_GetTime(const VideoBackendPlayer& player)
556{

Callers

nothing calls this directly

Calls 1

StopAudioMethod · 0.80

Tested by

no test coverage detected