Changeset 231c770 in mainline
- Timestamp:
- 2018-04-06T21:29:11Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 105fcf0
- Parents:
- 2f1c88e
- git-author:
- Jakub Jermar <jakub@…> (2018-04-06 20:59:41)
- git-committer:
- Jakub Jermar <jakub@…> (2018-04-06 21:29:11)
- Location:
- uspace/srv/audio/hound
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/audio_data.c
r2f1c88e r231c770 36 36 #include <macros.h> 37 37 #include <stdlib.h> 38 #include <str.h>39 38 40 39 #include "audio_data.h" … … 57 56 log_warning("Data not a multiple of frame size, " 58 57 "clipping."); 59 uint8_t *d = ((uint8_t *)adata) + offsetof(audio_data_t, data); 60 memcpy(d, data, size); 58 adata->data = data; 61 59 adata->size = size - overflow; 62 60 adata->format = format; … … 87 85 atomic_count_t refc = atomic_predec(&adata->refcount); 88 86 if (refc == 0) { 87 free((void *) adata->data); 89 88 free(adata); 90 89 } -
uspace/srv/audio/hound/audio_data.h
r2f1c88e r231c770 45 45 /** Reference counted audio buffer */ 46 46 typedef struct { 47 /** Audio data */ 48 const void *data; 47 49 /** Size of the buffer pointer to by data */ 48 50 size_t size; … … 51 53 /** Reference counter */ 52 54 atomic_t refcount; 53 /** Audio data */54 const uint8_t data[];55 55 } audio_data_t; 56 56
Note:
See TracChangeset
for help on using the changeset viewer.