OSDN Git Service

audio: make audio_attributes_t packed
authorEric Laurent <elaurent@google.com>
Thu, 16 Nov 2017 19:38:34 +0000 (11:38 -0800)
committerEric Laurent <elaurent@google.com>
Thu, 16 Nov 2017 19:38:34 +0000 (11:38 -0800)
Make struct audio_attributes packed as it is passed over binder

Test: AudioTrack CTS test
Change-Id: I51b1ef0f035ee078338482514723aaf0fb1de6c2

audio/include/system/audio.h

index e683d60..7e8cd4e 100644 (file)
@@ -84,7 +84,7 @@ typedef struct {
     audio_source_t       source;
     audio_flags_mask_t   flags;
     char                 tags[AUDIO_ATTRIBUTES_TAGS_MAX_SIZE]; /* UTF8 */
-} audio_attributes_t;
+} __attribute__((packed)) audio_attributes_t; // sent through Binder;
 
 /* a unique ID allocated by AudioFlinger for use as an audio_io_handle_t, audio_session_t,
  * effect ID (int), audio_module_handle_t, and audio_patch_handle_t.