simplify file interface for stream file interfaces, cleanup.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7042 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2007-12-31 19:41:39 +00:00
parent 445da648f2
commit 0932532e6c
3 changed files with 19 additions and 67 deletions
+16
View File
@@ -178,6 +178,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_write(switch_file_handle_t *fh,
switch_assert(fh != NULL);
switch_assert(fh->file_interface != NULL);
if (!fh->file_interface->file_write) {
return SWITCH_STATUS_FALSE;
}
if (!switch_test_flag(fh, SWITCH_FILE_NATIVE) && fh->native_rate != fh->samplerate) {
if (!fh->resampler) {
@@ -225,6 +229,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_seek(switch_file_handle_t *fh,
switch_assert(fh != NULL);
switch_assert(fh->file_interface != NULL);
if (!fh->file_interface->file_seek) {
return SWITCH_STATUS_FALSE;
}
switch_set_flag(fh, SWITCH_FILE_SEEK);
status = fh->file_interface->file_seek(fh, cur_pos, samples, whence);
if (samples) {
@@ -238,6 +246,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_set_string(switch_file_handle_t
switch_assert(fh != NULL);
switch_assert(fh->file_interface != NULL);
if (!fh->file_interface->file_set_string) {
return SWITCH_STATUS_FALSE;
}
return fh->file_interface->file_set_string(fh, col, string);
}
@@ -246,6 +258,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_get_string(switch_file_handle_t
switch_assert(fh != NULL);
switch_assert(fh->file_interface != NULL);
if (!fh->file_interface->file_get_string) {
return SWITCH_STATUS_FALSE;
}
return fh->file_interface->file_get_string(fh, col, string);
}