Skip to content
Snippets Groups Projects
Commit 16809aec authored by ph3-der-loewe's avatar ph3-der-loewe
Browse files

Added missing ao_file_extension() (close #1841)

git-svn-id: http://svn.xiph.org/trunk/ao@18200 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 43a7646a
No related branches found
No related tags found
No related merge requests found
1.1.1 - Not yet released
- Added missing ao_file_extension() (Closes: #1841)
1.1.0 - February 21, 2011
- Add autofoo ld symbol versioning to build system
- Update Roar driver to latest API
......
......@@ -27,7 +27,7 @@ ignore the recommended extension.</p>
<tr bgcolor=#cccccc>
<td>
<pre><b>
char* ao_file_extension(int driver_id);
const char* ao_file_extension(int driver_id);
</b></pre>
</td>
</tr>
......@@ -54,11 +54,11 @@ this driver does not exist.</li>
<hr noshade>
<table border=0 width=100%>
<tr valign=top>
<td><p class=tiny>copyright &copy; 2001-2003 Stan Seibert, 2010-2011 Monty</p></td>
<td><p class=tiny>copyright &copy; 2001-2003 Stan Seibert, 2010-2011 Monty, 2011 Philipp Schafft</p></td>
<td align=right><p class=tiny><a href="http://www.xiph.org/">xiph.org</a><br><a href="mailto:monty@xiph.org">monty@xiph.org</a></p></td>
</tr><tr>
<td><p class=tiny>libao documentation</p></td>
<td align=right><p class=tiny>libao version 1.1.0 - 20110221</p></td>
<td align=right><p class=tiny>libao version 1.1.0 - 20111222</p></td>
</tr>
</table>
......
......@@ -126,7 +126,7 @@ int ao_driver_id(const char *short_name);
int ao_default_driver_id(void);
ao_info *ao_driver_info(int driver_id);
ao_info **ao_driver_info_list(int *driver_count);
char *ao_file_extension(int driver_id);
const char *ao_file_extension(int driver_id);
/* miscellaneous */
int ao_is_big_endian(void);
......
......@@ -131,7 +131,7 @@ struct ao_functions {
uint_32 num_bytes);
int (*close)(ao_device *device);
void (*device_clear)(ao_device *device);
char* (*file_extension)(void);
const char* (*file_extension)(void);
};
/* --- Functions --- */
......
......@@ -42,7 +42,7 @@ int ao_plugin_play(ao_device *device, const char *output_samples,
uint_32 num_bytes);
int ao_plugin_close(ao_device *device);
void ao_plugin_device_clear(ao_device *device);
char *ao_plugin_file_extension();
const char *ao_plugin_file_extension();
#ifdef __cplusplus
}
......
......@@ -12,7 +12,7 @@ ao_driver_id ok
ao_default_driver_id ok
ao_driver_info ok
ao_driver_info_list ok
ao_file_extension wip Not yet implemented
ao_file_extension ok
# Options:
ao_append_global_option ok
......
......@@ -238,6 +238,12 @@ static void ao_au_device_clear(ao_device *device)
device->internal=NULL;
}
const char *ao_au_file_extension(void)
{
return "au";
}
ao_functions ao_au = {
ao_au_test,
ao_au_driver_info,
......@@ -246,5 +252,6 @@ ao_functions ao_au = {
ao_au_open,
ao_au_play,
ao_au_close,
ao_au_device_clear
ao_au_device_clear,
ao_au_file_extension
};
......@@ -147,6 +147,11 @@ static void ao_raw_device_clear(ao_device *device)
device->internal=NULL;
}
const char *ao_raw_file_extension(void)
{
return "raw";
}
ao_functions ao_raw = {
ao_raw_test,
......@@ -156,5 +161,6 @@ ao_functions ao_raw = {
ao_raw_open,
ao_raw_play,
ao_raw_close,
ao_raw_device_clear
ao_raw_device_clear,
ao_raw_file_extension
};
......@@ -278,6 +278,11 @@ static void ao_wav_device_clear(ao_device *device)
device->internal=NULL;
}
const char *ao_wav_file_extension(void)
{
return "wav";
}
ao_functions ao_wav = {
ao_wav_test,
......@@ -287,5 +292,6 @@ ao_functions ao_wav = {
ao_wav_open,
ao_wav_play,
ao_wav_close,
ao_wav_device_clear
ao_wav_device_clear,
ao_wav_file_extension
};
......@@ -4,6 +4,7 @@
*
* Original Copyright (C) Aaron Holtzman - May 1999
* Modifications Copyright (C) Stan Seibert - July 2000
* Modifications Copyright (C) Philipp Schafft - February 2012
*
* This file is part of libao, a cross-platform audio output library. See
* README for a history of this source code.
......@@ -1475,9 +1476,12 @@ ao_info *ao_driver_info(int driver_id)
{
driver_list *driver;
if ( (driver = _get_driver(driver_id)) )
return driver->functions->driver_info();
else
if ( (driver = _get_driver(driver_id)) ) {
if (driver->functions->driver_info != NULL)
return driver->functions->driver_info();
else
return NULL;
} else
return NULL;
}
......@@ -1488,6 +1492,18 @@ ao_info **ao_driver_info_list(int *count)
return info_table;
}
const char *ao_file_extension(int driver_id)
{
driver_list *driver;
if ( (driver = _get_driver(driver_id)) ) {
if (driver->functions->file_extension != NULL)
return driver->functions->file_extension();
else
return NULL;
} else
return NULL;
}
/* -- Miscellaneous -- */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment