Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a03f5008 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-951b3a8b-6c0c-4d2e-8af4-1c3f7e209f66-for-git_oc-release-400689...

release-request-951b3a8b-6c0c-4d2e-8af4-1c3f7e209f66-for-git_oc-release-4006899 snap-temp-L39600000063784275

Change-Id: I69889e974f5aaafd9b8db2ca5cb6bfbbd71a2f8d
parents 22122771 edf0b4c6
Loading
Loading
Loading
Loading
+19 −9
Original line number Original line Diff line number Diff line
@@ -582,8 +582,12 @@ int audio_extn_snd_mon_deinit()


    write(sndmonitor.intpipe[1], "Q", 1);
    write(sndmonitor.intpipe[1], "Q", 1);
    pthread_join(sndmonitor.monitor_thread, (void **) NULL);
    pthread_join(sndmonitor.monitor_thread, (void **) NULL);
    free_sndcards();
    free_dev_events();
    free_dev_events();
    listeners_deinit();
    free_sndcards();
    close(sndmonitor.intpipe[0]);
    close(sndmonitor.intpipe[1]);

    sndmonitor.initcheck = 0;
    sndmonitor.initcheck = 0;
    return 0;
    return 0;
}
}
@@ -597,13 +601,13 @@ int audio_extn_snd_mon_init()
    sndmonitor.initcheck = false;
    sndmonitor.initcheck = false;


    if (pipe(sndmonitor.intpipe) < 0)
    if (pipe(sndmonitor.intpipe) < 0)
        return -ENODEV;
        goto pipe_error;


    if (enum_sndcards() < 0)
    if (enum_sndcards() < 0)
        return -ENODEV;
        goto enum_sncards_error;


    if (listeners_init() < 0)
    if (listeners_init() < 0)
        return -ENODEV;
        goto listeners_error;


#ifdef MONITOR_DEVICE_EVENTS
#ifdef MONITOR_DEVICE_EVENTS
    enum_dev_events(); // failure here isn't fatal
    enum_dev_events(); // failure here isn't fatal
@@ -614,15 +618,21 @@ int audio_extn_snd_mon_init()
                             monitor_thread_loop, NULL);
                             monitor_thread_loop, NULL);


    if (ret) {
    if (ret) {
        goto monitor_thread_create_error;
    }
    sndmonitor.initcheck = true;
    return 0;

monitor_thread_create_error:
    listeners_deinit();
listeners_error:
    free_sndcards();
    free_sndcards();
        free_dev_events();
enum_sncards_error:
    close(sndmonitor.intpipe[0]);
    close(sndmonitor.intpipe[0]);
    close(sndmonitor.intpipe[1]);
    close(sndmonitor.intpipe[1]);
pipe_error:
    return -ENODEV;
    return -ENODEV;
}
}
    sndmonitor.initcheck = true;
    return 0;
}


int audio_extn_snd_mon_register_listener(void *stream, snd_mon_cb cb)
int audio_extn_snd_mon_register_listener(void *stream, snd_mon_cb cb)
{
{
+8 −6
Original line number Original line Diff line number Diff line
@@ -33,6 +33,7 @@
#include <dlfcn.h>
#include <dlfcn.h>
#include <sys/resource.h>
#include <sys/resource.h>
#include <sys/prctl.h>
#include <sys/prctl.h>
#include <limits.h>


#include <cutils/log.h>
#include <cutils/log.h>
#include <cutils/trace.h>
#include <cutils/trace.h>
@@ -2093,7 +2094,7 @@ static char* out_get_parameters(const struct audio_stream *stream, const char *k
        str_parms_add_str(reply, AUDIO_PARAMETER_STREAM_SUP_CHANNELS, value);
        str_parms_add_str(reply, AUDIO_PARAMETER_STREAM_SUP_CHANNELS, value);
        str = str_parms_to_str(reply);
        str = str_parms_to_str(reply);
    } else {
    } else {
        str = strdup(keys);
        str = strdup("");
    }
    }
    str_parms_destroy(query);
    str_parms_destroy(query);
    str_parms_destroy(reply);
    str_parms_destroy(reply);
@@ -2362,7 +2363,7 @@ static int out_get_render_position(const struct audio_stream_out *stream,
        pthread_mutex_unlock(&out->lock);
        pthread_mutex_unlock(&out->lock);
        return 0;
        return 0;
    } else
    } else
        return -EINVAL;
        return -ENODATA;
}
}


static int out_add_audio_effect(const struct audio_stream *stream __unused,
static int out_add_audio_effect(const struct audio_stream *stream __unused,
@@ -2380,14 +2381,14 @@ static int out_remove_audio_effect(const struct audio_stream *stream __unused,
static int out_get_next_write_timestamp(const struct audio_stream_out *stream __unused,
static int out_get_next_write_timestamp(const struct audio_stream_out *stream __unused,
                                        int64_t *timestamp __unused)
                                        int64_t *timestamp __unused)
{
{
    return -EINVAL;
    return -ENOSYS;
}
}


static int out_get_presentation_position(const struct audio_stream_out *stream,
static int out_get_presentation_position(const struct audio_stream_out *stream,
                                   uint64_t *frames, struct timespec *timestamp)
                                   uint64_t *frames, struct timespec *timestamp)
{
{
    struct stream_out *out = (struct stream_out *)stream;
    struct stream_out *out = (struct stream_out *)stream;
    int ret = -EINVAL;
    int ret = -ENODATA;
    unsigned long dsp_frames;
    unsigned long dsp_frames;


    lock_output_stream(out);
    lock_output_stream(out);
@@ -2812,7 +2813,7 @@ static char* in_get_parameters(const struct audio_stream *stream __unused,


static int in_set_gain(struct audio_stream_in *stream __unused, float gain __unused)
static int in_set_gain(struct audio_stream_in *stream __unused, float gain __unused)
{
{
    return 0;
    return -ENOSYS;
}
}


static void in_snd_mon_cb(void * stream, struct str_parms * parms)
static void in_snd_mon_cb(void * stream, struct str_parms * parms)
@@ -4054,10 +4055,11 @@ static int adev_close(hw_device_t *device)
    if (!adev)
    if (!adev)
        return 0;
        return 0;


    audio_extn_snd_mon_unregister_listener(adev);
    audio_extn_snd_mon_deinit();
    audio_extn_snd_mon_deinit();

    audio_extn_tfa_98xx_deinit();
    audio_extn_tfa_98xx_deinit();


    audio_extn_snd_mon_unregister_listener(adev);
    pthread_mutex_lock(&adev_init_lock);
    pthread_mutex_lock(&adev_init_lock);


    if ((--audio_device_ref_count) == 0) {
    if ((--audio_device_ref_count) == 0) {
+1 −0
Original line number Original line Diff line number Diff line
@@ -1054,6 +1054,7 @@ void platform_deinit(void *platform)
        free(info_item);
        free(info_item);
    }
    }


    mixer_close(my_data->adev->mixer);
    free(platform);
    free(platform);
}
}


+1 −0
Original line number Original line Diff line number Diff line
@@ -1483,6 +1483,7 @@ void platform_deinit(void *platform)
        free(info_item);
        free(info_item);
    }
    }


    mixer_close(my_data->adev->mixer);
    free(platform);
    free(platform);


    /* deinit usb */
    /* deinit usb */