- Timestamp:
- 01/08/09 22:03:17 (3 years ago)
- Location:
- trunk/fm_server/src
- Files:
-
- 2 modified
-
fm_buffer.c (modified) (3 diffs)
-
fm_buffer.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fm_server/src/fm_buffer.c
r246 r275 43 43 g_print ("Allocated a new buffer of %d samples, %d bytes\n", n_samples, size_bytes); 44 44 45 46 45 buffer = g_new0 (FmBuffer, 1); 47 46 buffer->data = g_malloc0 (size_bytes); 48 buffer->discont = FALSE;49 buffer->silence = FALSE;50 47 51 48 for (i = 0; i < n_channels; i++) … … 53 50 54 51 buffer->n_channels = n_channels; 55 56 52 buffer->allocated_samples = n_samples; 57 buffer->used_samples = 0;58 59 buffer->requested_samples = 0;60 53 61 buffer->timestamp_ns = 0; 62 // buffer->timestamp_samples = 0; 63 buffer->duration = 0; 64 54 fm_buffer_reset (buffer); 55 65 56 return buffer; 66 57 } … … 116 107 117 108 void 118 fm_buffer_reset _flags(FmBuffer *buffer)109 fm_buffer_reset (FmBuffer *buffer) 119 110 { 120 111 buffer->discont = FALSE; 121 112 buffer->silence = FALSE; 113 114 buffer->used_samples = 0; 115 buffer->requested_samples = 0; 116 122 117 buffer->timestamp_ns = -1; 123 // buffer->timestamp_samples = -1; 124 buffer->duration = 0; 118 buffer->duration = 0; 125 119 } -
trunk/fm_server/src/fm_buffer.h
r246 r275 40 40 gfloat *data; 41 41 gfloat * channel_data[FM_CHANNELS_LAST]; 42 guint n_channels; 43 42 44 gboolean discont; // the buffer is a start of a discontinuous section 43 45 gboolean silence; // the whole buffer contains silence 44 46 45 guint n_channels;46 47 47 guint allocated_samples; 48 48 guint used_samples; 49 50 49 guint requested_samples; 51 50 52 51 gint64 timestamp_ns; // real timestamp from start of the song 53 // gint64 timestamp_samples;54 52 guint64 duration; // real duration of AUDIO (not silence) in the buffer 55 53 }; … … 78 76 79 77 void 80 fm_buffer_reset _flags(FmBuffer *buffer);78 fm_buffer_reset (FmBuffer *buffer); 81 79 82 80
