Right samadhi is whatever samadhi there is coming from right view and right effort, which is really just the usual jhanas but seen from right view, right understanding, right doctrine and right effort, ie Samādhibhāvanā http://obo.genaud.net/dhamma-vinaya/pts/an/04_fours/an04.014.wood.pts.htm which is all about restraint, instead of being seen from some wrong understanding created by some puthujjana, including Patanjali.
For the buddha, the jhanas are abiding the in the pleasant present life, which are nice, but the right concentration is what makes ''yathā-bhūtaɱ pajānāti.'' ie seeing properly form , consciousness and all that.
"Develop concentration, monks.
A concentrated monk discerns in line with what has come into being.
And what does he discern in line with what has come into being?
The origination[1] and disappearance of form.
The origination and disappearance of feeling...
perception...
fabrications.
The origination and disappearance of consciousness.
"And what is the origination of form...
feeling...
perception...
fabrications?
What is the origination of consciousness?
"There is the case where one enjoys, welcomes, and remains fastened.
And what does one enjoy and welcome, to what does one remain fastened?
One enjoys, welcomes, and remains fastened to form.
As one enjoys, welcomes, and remains fastened to form, there arises
delight.
Any delight in form is clinging.
From clinging/sustenance as a requisite condition comes becoming.
From becoming as a requisite condition comes birth.
From birth as a requisite condition, then aging and death, sorrow,
lamentation, pain, distress, and despair come into play.
Such is the origination of this entire mass of stress and suffering.
"One enjoys, welcomes, and remains fastened to feeling...
perception...
fabrications...
"One enjoys, welcomes, and remains fastened to consciousness.
As one enjoys, welcomes, and remains fastened to consciousness, there
arises delight.
Any delight in consciousness is clinging.
From clinging/sustenance as a requisite condition comes becoming.
From becoming as a requisite condition comes birth.
From birth as a requisite condition, then aging and death, sorrow,
lamentation, pain, distress, and despair come into play.
Such is the origination of this entire mass of stress and suffering.
"This, monks, is the origination of form.
This, the origination of feeling...
perception...
fabrications.
This, the origination of consciousness."
"And what is the disappearance of form...
feeling...
perception...
fabrications?
What is the disappearance of consciousness?
"There is the case where one doesn’t enjoy, welcome, or remain
fastened.
And what does one not enjoy or welcome, to what does one not remain
fastened?
One doesn’t enjoy, welcome, or remain fastened to form.
As one doesn’t enjoy, welcome, or remain fastened to form, any delight
in form ceases.
From the cessation of delight comes the cessation of clinging.
From the cessation of clinging/sustenance, the cessation of becoming.
From the cessation of becoming, the cessation of birth.
From the cessation of birth, then aging and death, sorrow,
lamentation, pain, distress, and despair all cease.
Such is the cessation of this entire mass of stress and suffering.
"One doesn’t enjoy, welcome, or remain fastened to feeling...
perception...
fabrications...
"One doesn’t enjoy, welcome, or remain fastened to consciousness.
As one doesn’t enjoy, welcome, or remain fastened to consciousness,
any delight in consciousness ceases.
From the cessation of delight comes the cessation of clinging.
From the cessation of clinging/sustenance, the cessation of becoming.
From the cessation of becoming, the cessation of birth.
From the cessation of birth, then aging and death, sorrow,
lamentation, pain, distress, and despair all cease.
Such is the cessation of this entire mass of stress and suffering.
"This, monks, is the disappearance of form.
This, the disappearance of feeling...
perception...
fabrications.
This, the disappearance of consciousness."