mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 12:42:02 +00:00
add metadata functions to sound file api
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2139 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -213,6 +213,26 @@ static switch_status_t sndfile_file_write(switch_file_handle_t *handle, void *da
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t sndfile_file_set_string(switch_file_handle_t *handle, switch_audio_col_t col, const char *string)
|
||||
{
|
||||
sndfile_context *context = handle->private_info;
|
||||
|
||||
return sf_set_string(context->handle, (int)col, string) ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t sndfile_file_get_string(switch_file_handle_t *handle, switch_audio_col_t col, const char **string)
|
||||
{
|
||||
sndfile_context *context = handle->private_info;
|
||||
const char *s;
|
||||
|
||||
if ((s = sf_get_string(context->handle, (int)col))) {
|
||||
*string = s;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
/* Registration */
|
||||
|
||||
static char **supported_formats;
|
||||
@@ -224,6 +244,8 @@ static switch_file_interface_t sndfile_file_interface = {
|
||||
/*.file_read */ sndfile_file_read,
|
||||
/*.file_write */ sndfile_file_write,
|
||||
/*.file_seek */ sndfile_file_seek,
|
||||
/*.file_set_string */ sndfile_file_set_string,
|
||||
/*.file_get_string */ sndfile_file_get_string,
|
||||
/*.extens */ NULL,
|
||||
/*.next */ NULL,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user