mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-12 07:22:55 +00:00
[mod_httapi, mod_http_cache] pass through seek values tracked in handle on proxy file handles
This commit is contained in:
parent
2ceec0b7f8
commit
243fc44f45
@ -2885,13 +2885,21 @@ static switch_status_t locate_url_file(http_file_context_t *context, const char
|
||||
static switch_status_t http_file_file_seek(switch_file_handle_t *handle, unsigned int *cur_sample, int64_t samples, int whence)
|
||||
{
|
||||
http_file_context_t *context = handle->private_info;
|
||||
|
||||
switch_status_t status;
|
||||
|
||||
if (!handle->seekable) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "File is not seekable\n");
|
||||
return SWITCH_STATUS_NOTIMPL;
|
||||
}
|
||||
|
||||
return switch_core_file_seek(&context->fh, cur_sample, samples, whence);
|
||||
if ((status = switch_core_file_seek(&context->fh, cur_sample, samples, whence)) == SWITCH_STATUS_SUCCESS) {
|
||||
handle->pos = context->fh.pos;
|
||||
handle->offset_pos = context->fh.offset_pos;
|
||||
handle->samples_in = context->fh.samples_in;
|
||||
handle->samples_out = context->fh.samples_out;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static switch_status_t file_open(switch_file_handle_t *handle, const char *path, int is_https)
|
||||
|
@ -1936,13 +1936,22 @@ static switch_status_t http_file_close(switch_file_handle_t *handle)
|
||||
|
||||
static switch_status_t http_cache_file_seek(switch_file_handle_t *handle, unsigned int *cur_sample, int64_t samples, int whence)
|
||||
{
|
||||
struct http_context *context = (struct http_context *)handle->private_info;
|
||||
struct http_context *context = (struct http_context *)handle->private_info;
|
||||
switch_status_t status;
|
||||
|
||||
if (!handle->seekable) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "File is not seekable\n");
|
||||
return SWITCH_STATUS_NOTIMPL;
|
||||
}
|
||||
|
||||
if (!handle->seekable) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "File is not seekable\n");
|
||||
return SWITCH_STATUS_NOTIMPL;
|
||||
}
|
||||
return switch_core_file_seek(&context->fh, cur_sample, samples, whence);
|
||||
if ((status = switch_core_file_seek(&context->fh, cur_sample, samples, whence)) == SWITCH_STATUS_SUCCESS) {
|
||||
handle->pos = context->fh.pos;
|
||||
handle->offset_pos = context->fh.offset_pos;
|
||||
handle->samples_in = context->fh.samples_in;
|
||||
handle->samples_out = context->fh.samples_out;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static char *http_supported_formats[] = { "http", NULL };
|
||||
|
Loading…
x
Reference in New Issue
Block a user