summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/mpegplayer/pcm_output.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/plugins/mpegplayer/pcm_output.c b/apps/plugins/mpegplayer/pcm_output.c
index 0b8ad7701a..fb7ff434aa 100644
--- a/apps/plugins/mpegplayer/pcm_output.c
+++ b/apps/plugins/mpegplayer/pcm_output.c
@@ -127,20 +127,21 @@ static void get_more(unsigned char **start, size_t *size)
127 else if (offset < 100*CLOCK_RATE/1000) 127 else if (offset < 100*CLOCK_RATE/1000)
128 { 128 {
129 /* Frame less than 100ms early - play it */ 129 /* Frame less than 100ms early - play it */
130 *start = pcmbuf_head->data; 130 struct pcm_frame_header *head = pcmbuf_head;
131 131
132 pcm_advance_buffer(&pcmbuf_head, sz); 132 pcm_advance_buffer(&pcmbuf_head, sz);
133 pcmbuf_curr_size = sz; 133 pcmbuf_curr_size = sz;
134 134
135 sz -= PCM_HDR_SIZE; 135 sz -= PCM_HDR_SIZE;
136 136
137 *size = sz;
138
139 /* Audio is time master - keep clock synchronized */ 137 /* Audio is time master - keep clock synchronized */
140 clock_time = time + (sz >> 2); 138 clock_time = time + (sz >> 2);
141 139
142 /* Update base clock */ 140 /* Update base clock */
143 clock_tick += sz >> 2; 141 clock_tick += sz >> 2;
142
143 *start = head->data;
144 *size = sz;
144 return; 145 return;
145 } 146 }
146 /* Frame will be dropped - play silence clip */ 147 /* Frame will be dropped - play silence clip */
@@ -157,12 +158,12 @@ static void get_more(unsigned char **start, size_t *size)
157 } 158 }
158 159
159 /* Keep clock going at all times */ 160 /* Keep clock going at all times */
161 clock_time += sizeof (silence) / 4;
162 clock_tick += sizeof (silence) / 4;
163
160 *start = (unsigned char *)silence; 164 *start = (unsigned char *)silence;
161 *size = sizeof (silence); 165 *size = sizeof (silence);
162 166
163 clock_tick += sizeof (silence) / 4;
164 clock_time += sizeof (silence) / 4;
165
166 if (sz < 0) 167 if (sz < 0)
167 pcmbuf_read = pcmbuf_written; 168 pcmbuf_read = pcmbuf_written;
168} 169}