audiohal source changes to support GCC5.2

Change-Id: Iec41af00e07fabb070ae51daa8d4f2ffd7ffae49
This commit is contained in:
puneet 2017-08-02 10:33:23 +05:30 committed by Garmond Leung
parent 26b690bc97
commit c4625f3391
2 changed files with 30 additions and 30 deletions

View File

@ -17,8 +17,8 @@ library_includedir = $(includedir)/mm-audio/qahw_api/inc
lib_LTLIBRARIES = libqahw.la
libqahw_la_SOURCES = src/qahw.c \
src/qahw_effect.c
libqahw_la_CFLAGS = $(AM_CFLAGS) -include stddef.h
libqahw_la_CFLAGS = -Dstrlcpy=g_strlcpy $(GLIB_CFLAGS) -include glib.h $(AM_CFLAGS) -include stddef.h
libqahw_la_CFLAGS += -D__unused=__attribute__\(\(__unused__\)\)
libqahw_la_CFLAGS += -Wno-sign-compare -Werror
libqahw_la_LIBADD = -llog -lcutils -lhardware
libqahw_la_LIBADD = $(GLIB_LIBS) -llog -lcutils -lhardware
libqahw_la_LDFLAGS = -module -shared -avoid-version

View File

@ -138,6 +138,34 @@ void break_signal_handler(int signal __attribute__((unused)))
stop_loopback = true;
}
int poll_data_event_init()
{
struct sockaddr_nl sock_addr;
int sz = (64*1024);
int soc;
memset(&sock_addr, 0, sizeof(sock_addr));
sock_addr.nl_family = AF_NETLINK;
sock_addr.nl_pid = getpid();
sock_addr.nl_groups = 0xffffffff;
soc = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT);
if (soc < 0) {
return 0;
}
setsockopt(soc, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz));
if (bind(soc, (struct sockaddr*) &sock_addr, sizeof(sock_addr)) < 0) {
close(soc);
return 0;
}
sock_event_fd = soc;
return (soc > 0);
}
void init_transcode_loopback_config(transcode_loopback_config_t **p_transcode_loopback_config)
{
fprintf(log_file,"\nInitializing global transcode loopback config\n");
@ -396,34 +424,6 @@ static int unload_hals(void) {
}
int poll_data_event_init()
{
struct sockaddr_nl sock_addr;
int sz = (64*1024);
int soc;
memset(&sock_addr, 0, sizeof(sock_addr));
sock_addr.nl_family = AF_NETLINK;
sock_addr.nl_pid = getpid();
sock_addr.nl_groups = 0xffffffff;
soc = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT);
if (soc < 0) {
return 0;
}
setsockopt(soc, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz));
if (bind(soc, (struct sockaddr*) &sock_addr, sizeof(sock_addr)) < 0) {
close(soc);
return 0;
}
sock_event_fd = soc;
return (soc > 0);
}
void source_data_event_handler(transcode_loopback_config_t *transcode_loopback_config)
{
int status =0;