~ubuntu-branches/ubuntu/trusty/sflphone/trusty

« back to all changes in this revision

Viewing changes to daemon/libs/iax2/jitterbuf.c

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (4.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20140128182336-jrsv0k9u6cawc068
Tags: 1.3.0-1
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
                        for (j=0;j<JB_HISTORY_MAXBUF_SZ;j++) {
238
238
                                /* found where it fits */
239
239
                                if (toins > jb->hist_maxbuf[j]) {
240
 
                                        /* move over */
241
 
                                        memmove(jb->hist_maxbuf + j + 1, jb->hist_maxbuf + j, (JB_HISTORY_MAXBUF_SZ - (j + 1)) * sizeof(jb->hist_maxbuf[0]));
 
240
                                        /* move over if there's space */
 
241
                    const size_t slide = (JB_HISTORY_MAXBUF_SZ - (j + 1)) * sizeof(jb->hist_maxbuf[0]);
 
242
                                        if (j < (JB_HISTORY_MAXBUF_SZ - 1))
 
243
                                                memmove(jb->hist_maxbuf + j + 1, jb->hist_maxbuf + j, slide);
242
244
                                        /* insert */
243
245
                                        jb->hist_maxbuf[j] = toins;
244
246
 
254
256
                        for (j=0;j<JB_HISTORY_MAXBUF_SZ;j++) {
255
257
                                /* found where it fits */
256
258
                                if (toins < jb->hist_minbuf[j]) {
257
 
                                        /* move over */
258
 
                                        memmove(jb->hist_minbuf + j + 1, jb->hist_minbuf + j, (JB_HISTORY_MAXBUF_SZ - (j + 1)) * sizeof(jb->hist_minbuf[0]));
 
259
                                        /* move over if there's space */
 
260
                                        const size_t slide = (JB_HISTORY_MAXBUF_SZ - (j + 1)) * sizeof(jb->hist_minbuf[0]);
 
261
                                        if (j < (JB_HISTORY_MAXBUF_SZ - 1))
 
262
                                                memmove(jb->hist_minbuf + j + 1, jb->hist_minbuf + j, slide);
259
263
                                        /* insert */
260
264
                                        jb->hist_minbuf[j] = toins;
261
265
 
263
267
                                }
264
268
                        }
265
269
                }
266
 
 
267
 
                if (0) {
268
 
                        int k;
269
 
                        fprintf(stderr, "toins = %ld\n", toins);
270
 
                        fprintf(stderr, "maxbuf =");
271
 
                        for (k=0;k<JB_HISTORY_MAXBUF_SZ;k++)
272
 
                                fprintf(stderr, "%ld ", jb->hist_maxbuf[k]);
273
 
                        fprintf(stderr, "\nminbuf =");
274
 
                        for (k=0;k<JB_HISTORY_MAXBUF_SZ;k++)
275
 
                                fprintf(stderr, "%ld ", jb->hist_minbuf[k]);
276
 
                        fprintf(stderr, "\n");
277
 
                }
278
270
        }
279
271
 
280
272
        jb->hist_maxbuf_valid = 1;