ValidatePlayerState(PlayerState.Idle);
ValidationUtil.ValidateEnum(typeof(PlayerAudioExtractOption), option, nameof(option));
- IntPtr formatHandle = IntPtr.Zero;
-
_audioFrameDecodedCallback = (IntPtr packetHandle, IntPtr userData) =>
{
var handler = AudioDataDecoded;
}
};
- formatHandle = format.AsNativeHandle();
-
- NativePlayer.SetAudioFrameDecodedCb(Handle, formatHandle, option, _audioFrameDecodedCallback, IntPtr.Zero).
- ThrowIfFailed(this, "Failed to register the _audioFrameDecoded");
+ NativePlayer.SetAudioFrameDecodedCb(Handle, format == null ? IntPtr.Zero : format.AsNativeHandle(), option,
+ _audioFrameDecodedCallback, IntPtr.Zero).ThrowIfFailed(this, "Failed to register the _audioFrameDecoded");
}
/// <summary>