mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 00:41:41 +00:00
only find exact ts not a range
This commit is contained in:
parent
ca2f66217d
commit
96b450817a
@ -770,7 +770,7 @@ static int stfu_n_find_any_frame(stfu_instance_t *in, stfu_queue_t *queue, stfu_
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int stfu_n_find_frame(stfu_instance_t *in, stfu_queue_t *queue, uint32_t min_ts, uint32_t max_ts, stfu_frame_t **r_frame)
|
static int stfu_n_find_frame(stfu_instance_t *in, stfu_queue_t *queue, uint32_t ts, stfu_frame_t **r_frame)
|
||||||
{
|
{
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
stfu_frame_t *frame = NULL;
|
stfu_frame_t *frame = NULL;
|
||||||
@ -782,7 +782,7 @@ static int stfu_n_find_frame(stfu_instance_t *in, stfu_queue_t *queue, uint32_t
|
|||||||
for(i = 0; i < queue->array_len; i++) {
|
for(i = 0; i < queue->array_len; i++) {
|
||||||
frame = &queue->array[i];
|
frame = &queue->array[i];
|
||||||
|
|
||||||
if (frame->ts == max_ts || (frame->ts > min_ts && frame->ts < max_ts)) {
|
if (frame->ts == ts) {
|
||||||
if (r_frame) {
|
if (r_frame) {
|
||||||
*r_frame = frame;
|
*r_frame = frame;
|
||||||
queue->last_index = i;
|
queue->last_index = i;
|
||||||
@ -856,21 +856,16 @@ stfu_frame_t *stfu_n_read_a_frame(stfu_instance_t *i)
|
|||||||
i->cur_seq++;
|
i->cur_seq++;
|
||||||
}
|
}
|
||||||
|
|
||||||
found = stfu_n_find_frame(i, i->out_queue, i->last_wr_ts, i->cur_ts, &rframe);
|
found = stfu_n_find_frame(i, i->out_queue, i->cur_ts, &rframe);
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
found = stfu_n_find_frame(i, i->in_queue, i->last_wr_ts, i->cur_ts, &rframe);
|
found = stfu_n_find_frame(i, i->in_queue, i->cur_ts, &rframe);
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
found = stfu_n_find_frame(i, i->old_queue, i->last_wr_ts, i->cur_ts, &rframe);
|
found = stfu_n_find_frame(i, i->old_queue, i->cur_ts, &rframe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found) {
|
|
||||||
i->cur_ts = rframe->ts;
|
|
||||||
i->cur_seq = rframe->seq;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i->sync_out) {
|
if (i->sync_out) {
|
||||||
if (!found) {
|
if (!found) {
|
||||||
if ((found = stfu_n_find_any_frame(i, i->out_queue, &rframe, 1))) {
|
if ((found = stfu_n_find_any_frame(i, i->out_queue, &rframe, 1))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user