Skip to content

Commit

Permalink
Enable the ao_set_metadata* functions if available from libshairport.
Browse files Browse the repository at this point in the history
  • Loading branch information
amejia1 committed Jun 17, 2012
1 parent d69e59f commit 537bec4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions configure.in
Expand Up @@ -1188,6 +1188,7 @@ if test "x$use_airtunes" != "xno"; then
if test "x$use_airtunes" != "xno"; then
XB_FIND_SONAME([SHAIRPORT], [shairport], [use_airtunes])
USE_AIRTUNES=1
AC_CHECK_MEMBERS(AudioOutput.ao_set_metadata AudioOutput.ao_set_metadata_coverart)
fi
fi

Expand Down
8 changes: 6 additions & 2 deletions xbmc/network/AirTunesServer.cpp
Expand Up @@ -389,6 +389,7 @@ int CAirTunesServer::AudioOutputFunctions::ao_close(ao_device *device)
return 0;
}

#ifdef HAVE_AUDIOOUTPUT_AO_SET_METADATA_AUDIOOUTPUT_AO_SET_METADATA_COVERART
void CAirTunesServer::AudioOutputFunctions::ao_set_metadata(const char *buffer, unsigned int size)
{
CAirTunesServer::SetMetadataFromBuffer(buffer, size);
Expand All @@ -398,6 +399,7 @@ void CAirTunesServer::AudioOutputFunctions::ao_set_metadata_coverart(const char
{
CAirTunesServer::SetCoverArtFromBuffer(buffer, size);
}
#endif

/* -- Device Setup/Playback/Teardown -- */
int CAirTunesServer::AudioOutputFunctions::ao_append_option(ao_option **options, const char *key, const char *value)
Expand Down Expand Up @@ -667,8 +669,10 @@ bool CAirTunesServer::Initialize(const CStdString &password)
ao.ao_append_option = AudioOutputFunctions::ao_append_option;
ao.ao_free_options = AudioOutputFunctions::ao_free_options;
ao.ao_get_option = AudioOutputFunctions::ao_get_option;
ao.ao_set_metadata = AudioOutputFunctions::ao_set_metadata;
ao.ao_set_metadata_coverart = AudioOutputFunctions::ao_set_metadata_coverart;
#ifdef HAVE_AUDIOOUTPUT_AO_SET_METADATA_AUDIOOUTPUT_AO_SET_METADATA_COVERART
ao.ao_set_metadata = AudioOutputFunctions::ao_set_metadata;
ao.ao_set_metadata_coverart = AudioOutputFunctions::ao_set_metadata_coverart;
#endif
struct printfPtr funcPtr;
funcPtr.extprintf = shairport_log;

Expand Down
4 changes: 3 additions & 1 deletion xbmc/network/AirTunesServer.h
Expand Up @@ -96,8 +96,10 @@ class CAirTunesServer : public CThread
static int ao_append_option(ao_option **options, const char *key, const char *value);
static void ao_free_options(ao_option *options);
static char* ao_get_option(ao_option *options, const char* key);
#ifdef HAVE_AUDIOOUTPUT_AO_SET_METADATA_AUDIOOUTPUT_AO_SET_METADATA_COVERART
static void ao_set_metadata(const char *buffer, unsigned int size);
static void ao_set_metadata_coverart(const char *buffer, unsigned int size);
static void ao_set_metadata_coverart(const char *buffer, unsigned int size);
#endif
#endif
};
};
Expand Down

0 comments on commit 537bec4

Please sign in to comment.