Recurrent event processes describe the stochastic repetition of an event over time. Recurrent event times are often censored with dependence between the censoring time and recurrence process. For instance, recurrent disease events are censored by a terminal event such as death, while frailty might affect both disease recurrence and survival. As such, it is important to model the recurrent event process and the event time process jointly to better capture the dependency between them and improve interpretability of the results. We propose a model in which the number of gap times, i.e. the time between two consecutive recurrent events, before the terminal event occurs is a random variable of interest. Then, conditionally on the number of recurrent events, we specify a joint distribution for the gap times and the survival time. Dependence between the the recurrence and survival processes is introduced by specifying a joint distribution on their respective frailty terms. Moreover, an autoregressive model of order one is assumed to model the evolution of gap times over time. A non-parametric random effects distribution for the frailty terms accommodates population heterogeneity and allows for data-driven clustering of the subjects. Posterior inference is performed through a a Gibbs sampler strategy involving a reversible jump step and slice sampling. We illustrate our model on atrial fibrillation data and compare the performance of our model with existing approaches.