mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-04 17:51:03 +00:00
FS-10076: [mod_av] File sync issues with different framerates #resolve
This commit is contained in:
parent
5e6ff638cf
commit
3a18464f7e
@ -2274,6 +2274,7 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f
|
|||||||
return SWITCH_STATUS_BREAK;
|
return SWITCH_STATUS_BREAK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (context->last_img) {
|
if (context->last_img) {
|
||||||
if (mst->next_pts && (switch_time_now() - mst->next_pts > max_delta)) {
|
if (mst->next_pts && (switch_time_now() - mst->next_pts > max_delta)) {
|
||||||
switch_img_free(&context->last_img); // too late
|
switch_img_free(&context->last_img); // too late
|
||||||
@ -2294,6 +2295,7 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f
|
|||||||
return SWITCH_STATUS_BREAK;
|
return SWITCH_STATUS_BREAK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (st->codec->time_base.num) {
|
if (st->codec->time_base.num) {
|
||||||
ticks = st->parser ? st->parser->repeat_pict + 1 : st->codec->ticks_per_frame;
|
ticks = st->parser ? st->parser->repeat_pict + 1 : st->codec->ticks_per_frame;
|
||||||
@ -2308,11 +2310,17 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f
|
|||||||
|
|
||||||
again:
|
again:
|
||||||
|
|
||||||
|
if (context->last_img) {
|
||||||
|
pop = (void *) context->last_img;
|
||||||
|
context->last_img = NULL;
|
||||||
|
status = SWITCH_STATUS_SUCCESS;
|
||||||
|
} else {
|
||||||
if ((flags & SVR_BLOCK)) {
|
if ((flags & SVR_BLOCK)) {
|
||||||
status = switch_queue_pop(context->eh.video_queue, &pop);
|
status = switch_queue_pop(context->eh.video_queue, &pop);
|
||||||
} else {
|
} else {
|
||||||
status = switch_queue_trypop(context->eh.video_queue, &pop);
|
status = switch_queue_trypop(context->eh.video_queue, &pop);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (pop && status == SWITCH_STATUS_SUCCESS) {
|
if (pop && status == SWITCH_STATUS_SUCCESS) {
|
||||||
switch_image_t *img = (switch_image_t *)pop;
|
switch_image_t *img = (switch_image_t *)pop;
|
||||||
@ -2354,7 +2362,7 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & SVR_BLOCK) || do_fl) {
|
if ((flags & SVR_BLOCK)) {
|
||||||
while (switch_micro_time_now() - mst->next_pts < -10000) {
|
while (switch_micro_time_now() - mst->next_pts < -10000) {
|
||||||
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "yield, delta=%" SWITCH_INT64_T_FMT "\n", switch_micro_time_now() - mst->next_pts);
|
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "yield, delta=%" SWITCH_INT64_T_FMT "\n", switch_micro_time_now() - mst->next_pts);
|
||||||
switch_yield(1000);
|
switch_yield(1000);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user