~ubuntu-branches/ubuntu/oneiric/openal-soft/oneiric

« back to all changes in this revision

Viewing changes to OpenAL32/alSource.c

  • Committer: Bazaar Package Importer
  • Author(s): Andres Mejia
  • Date: 2009-11-25 14:59:51 UTC
  • Revision ID: james.westby@ubuntu.com-20091125145951-0dl33wc4qj3x3zt4
Tags: 1:1.10.622-1
* New upstream release.
* Issue with using PulseAudio backend fixed.
  (Closes: #548373)
  (Closes: #551018)
* Switch to Debian source format 3.0 (quilt).

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
                    {
143
143
                        ALBufferList = ALSource->queue;
144
144
                        // Decrement buffer's reference counter
145
 
                        if(ALBufferList->buffer != 0)
146
 
                            ((ALbuffer*)(ALTHUNK_LOOKUPENTRY(ALBufferList->buffer)))->refcount--;
 
145
                        if(ALBufferList->buffer != NULL)
 
146
                            ALBufferList->buffer->refcount--;
147
147
                        // Update queue to point to next element in list
148
148
                        ALSource->queue = ALBufferList->next;
149
149
                        // Release memory allocated for buffer list item
462
462
    ALCcontext          *pContext;
463
463
    ALsource            *pSource;
464
464
    ALbufferlistitem    *pALBufferListItem;
465
 
    ALuint i;
466
465
 
467
466
    pContext = GetContextSuspended();
468
467
    if(!pContext) return;
502
501
 
503
502
            case AL_LOOPING:
504
503
                if(lValue == AL_FALSE || lValue == AL_TRUE)
505
 
                {
506
504
                    pSource->bLooping = (ALboolean)lValue;
507
 
 
508
 
                    pALBufferListItem = pSource->queue;
509
 
                    for(i = 0;pALBufferListItem != NULL;i++)
510
 
                    {
511
 
                        if(lValue == AL_FALSE && i <= pSource->BuffersPlayed)
512
 
                            pALBufferListItem->bufferstate = PROCESSED;
513
 
                        else
514
 
                            pALBufferListItem->bufferstate = PENDING;
515
 
                        pALBufferListItem = pALBufferListItem->next;
516
 
                    }
517
 
                }
518
505
                else
519
506
                    alSetError(AL_INVALID_VALUE);
520
507
                break;
524
511
                {
525
512
                    if(alIsBuffer(lValue))
526
513
                    {
 
514
                        ALbuffer *buffer = NULL;
 
515
 
527
516
                        // Remove all elements in the queue
528
517
                        while(pSource->queue != NULL)
529
518
                        {
530
519
                            pALBufferListItem = pSource->queue;
531
520
                            pSource->queue = pALBufferListItem->next;
532
521
                            // Decrement reference counter for buffer
533
 
                            if (pALBufferListItem->buffer)
534
 
                                ((ALbuffer*)(ALTHUNK_LOOKUPENTRY(pALBufferListItem->buffer)))->refcount--;
 
522
                            if(pALBufferListItem->buffer)
 
523
                                pALBufferListItem->buffer->refcount--;
535
524
                            // Release memory for buffer list item
536
525
                            free(pALBufferListItem);
537
526
                            // Decrement the number of buffers in the queue
541
530
                        // Add the buffer to the queue (as long as it is NOT the NULL buffer)
542
531
                        if(lValue != 0)
543
532
                        {
 
533
                            buffer = (ALbuffer*)ALTHUNK_LOOKUPENTRY(lValue);
 
534
 
544
535
                            // Source is now in STATIC mode
545
536
                            pSource->lSourceType = AL_STATIC;
546
537
 
547
538
                            // Add the selected buffer to the queue
548
539
                            pALBufferListItem = malloc(sizeof(ALbufferlistitem));
549
 
                            pALBufferListItem->buffer = lValue;
550
 
                            pALBufferListItem->bufferstate = PENDING;
551
 
                            pALBufferListItem->flag = 0;
 
540
                            pALBufferListItem->buffer = buffer;
552
541
                            pALBufferListItem->next = NULL;
553
542
 
554
543
                            pSource->queue = pALBufferListItem;
555
544
                            pSource->BuffersInQueue = 1;
556
545
 
557
546
                            // Increment reference counter for buffer
558
 
                            ((ALbuffer*)(ALTHUNK_LOOKUPENTRY(lValue)))->refcount++;
 
547
                            buffer->refcount++;
559
548
                        }
560
549
                        else
561
550
                        {
565
554
                        }
566
555
 
567
556
                        // Update AL_BUFFER parameter
568
 
                        pSource->ulBufferID = lValue;
 
557
                        pSource->Buffer = buffer;
569
558
                    }
570
559
                    else
571
560
                        alSetError(AL_INVALID_VALUE);
1050
1039
                    break;
1051
1040
 
1052
1041
                case AL_BUFFER:
1053
 
                    *plValue = pSource->ulBufferID;
 
1042
                    *plValue = (pSource->Buffer ? pSource->Buffer->buffer : 0);
1054
1043
                    break;
1055
1044
 
1056
1045
                case AL_SOURCE_STATE:
1302
1291
                ALBufferList = pSource->queue;
1303
1292
                while(ALBufferList)
1304
1293
                {
1305
 
                    if(ALBufferList->buffer != 0 && ((ALbuffer*)ALTHUNK_LOOKUPENTRY(ALBufferList->buffer))->size)
 
1294
                    if(ALBufferList->buffer != NULL && ALBufferList->buffer->size)
1306
1295
                    {
1307
1296
                        bPlay = AL_TRUE;
1308
1297
                        break;
1320
1309
                    if(pSource->state != AL_PAUSED)
1321
1310
                    {
1322
1311
                        pSource->state = AL_PLAYING;
1323
 
                        pSource->inuse = AL_TRUE;
1324
 
                        pSource->play = AL_TRUE;
1325
1312
                        pSource->position = 0;
1326
1313
                        pSource->position_fraction = 0;
1327
1314
                        pSource->BuffersPlayed = 0;
1328
1315
 
1329
 
                        pSource->ulBufferID = pSource->queue->buffer;
1330
 
 
1331
 
                        // Make sure all the Buffers in the queue are marked as PENDING
1332
 
                        ALBufferList = pSource->queue;
1333
 
                        while(ALBufferList)
1334
 
                        {
1335
 
                            ALBufferList->bufferstate = PENDING;
1336
 
                            ALBufferList = ALBufferList->next;
1337
 
                        }
 
1316
                        pSource->Buffer = pSource->queue->buffer;
1338
1317
                    }
1339
1318
                    else
1340
 
                    {
1341
1319
                        pSource->state = AL_PLAYING;
1342
 
                        pSource->inuse = AL_TRUE;
1343
 
                        pSource->play = AL_TRUE;
1344
 
                    }
1345
1320
 
1346
1321
                    // Check if an Offset has been set
1347
1322
                    if(pSource->lOffset)
1357
1332
                    if(!pContext->Device->Connected)
1358
1333
                    {
1359
1334
                        pSource->state = AL_STOPPED;
1360
 
                        pSource->inuse = AL_FALSE;
1361
1335
                        pSource->BuffersPlayed = pSource->BuffersInQueue;
1362
 
                        ALBufferList = pSource->queue;
1363
 
                        while(ALBufferList != NULL)
1364
 
                        {
1365
 
                            ALBufferList->bufferstate = PROCESSED;
1366
 
                            ALBufferList = ALBufferList->next;
1367
 
                        }
1368
1336
                        pSource->position = 0;
1369
1337
                        pSource->position_fraction = 0;
1370
1338
                    }
1371
1339
                }
1372
1340
                else
1373
 
                {
1374
 
                    // If there is a queue (must all be NULL or Zero length Buffers) mark them all as processed
1375
 
                    ALBufferList = pSource->queue;
1376
 
                    while(ALBufferList)
1377
 
                    {
1378
 
                        ALBufferList->bufferstate = PROCESSED;
1379
 
                        ALBufferList = ALBufferList->next;
1380
 
                    }
1381
 
 
1382
1341
                    pSource->BuffersPlayed = pSource->BuffersInQueue;
1383
 
                }
1384
1342
            }
1385
1343
        }
1386
1344
    }
1428
1386
            {
1429
1387
                Source = (ALsource*)ALTHUNK_LOOKUPENTRY(sources[i]);
1430
1388
                if(Source->state == AL_PLAYING)
1431
 
                {
1432
1389
                    Source->state = AL_PAUSED;
1433
 
                    Source->inuse = AL_FALSE;
1434
 
                }
1435
1390
            }
1436
1391
        }
1437
1392
    }
1455
1410
    ALCcontext *Context;
1456
1411
    ALsource *Source;
1457
1412
    ALsizei i;
1458
 
    ALbufferlistitem *ALBufferListItem;
1459
1413
    ALboolean bSourcesValid = AL_TRUE;
1460
1414
 
1461
1415
    Context = GetContextSuspended();
1482
1436
                if(Source->state != AL_INITIAL)
1483
1437
                {
1484
1438
                    Source->state = AL_STOPPED;
1485
 
                    Source->inuse = AL_FALSE;
1486
1439
                    Source->BuffersPlayed = Source->BuffersInQueue;
1487
 
                    ALBufferListItem = Source->queue;
1488
 
                    while(ALBufferListItem != NULL)
1489
 
                    {
1490
 
                        ALBufferListItem->bufferstate = PROCESSED;
1491
 
                        ALBufferListItem = ALBufferListItem->next;
1492
 
                    }
1493
1440
                }
1494
1441
                Source->lOffset = 0;
1495
1442
            }
1515
1462
    ALCcontext *Context;
1516
1463
    ALsource *Source;
1517
1464
    ALsizei i;
1518
 
    ALbufferlistitem *ALBufferListItem;
1519
1465
    ALboolean bSourcesValid = AL_TRUE;
1520
1466
 
1521
1467
    Context = GetContextSuspended();
1542
1488
                if(Source->state != AL_INITIAL)
1543
1489
                {
1544
1490
                    Source->state = AL_INITIAL;
1545
 
                    Source->inuse = AL_FALSE;
1546
1491
                    Source->position = 0;
1547
1492
                    Source->position_fraction = 0;
1548
1493
                    Source->BuffersPlayed = 0;
1549
 
                    ALBufferListItem = Source->queue;
1550
 
                    while(ALBufferListItem != NULL)
1551
 
                    {
1552
 
                        ALBufferListItem->bufferstate = PENDING;
1553
 
                        ALBufferListItem = ALBufferListItem->next;
1554
 
                    }
1555
1494
                    if(Source->queue)
1556
 
                        Source->ulBufferID = Source->queue->buffer;
 
1495
                        Source->Buffer = Source->queue->buffer;
1557
1496
                }
1558
1497
                Source->lOffset = 0;
1559
1498
            }
1605
1544
            {
1606
1545
                if (ALBufferList->buffer)
1607
1546
                {
1608
 
                    iFrequency = ((ALbuffer*)(ALTHUNK_LOOKUPENTRY(ALBufferList->buffer)))->frequency;
1609
 
                    iFormat = ((ALbuffer*)(ALTHUNK_LOOKUPENTRY(ALBufferList->buffer)))->format;
 
1547
                    iFrequency = ALBufferList->buffer->frequency;
 
1548
                    iFormat = ALBufferList->buffer->format;
1610
1549
                    break;
1611
1550
                }
1612
1551
                ALBufferList = ALBufferList->next;
1614
1553
 
1615
1554
            for(i = 0; i < n; i++)
1616
1555
            {
1617
 
                if(alIsBuffer(buffers[i]))
1618
 
                {
1619
 
                    if(buffers[i])
1620
 
                    {
1621
 
                        if((iFrequency == -1) && (iFormat == -1))
1622
 
                        {
1623
 
                            iFrequency = ((ALbuffer*)(ALTHUNK_LOOKUPENTRY(buffers[i])))->frequency;
1624
 
                            iFormat = ((ALbuffer*)(ALTHUNK_LOOKUPENTRY(buffers[i])))->format;
1625
 
                        }
1626
 
                        else
1627
 
                        {
1628
 
                            if((iFrequency != ((ALbuffer*)(ALTHUNK_LOOKUPENTRY(buffers[i])))->frequency) ||
1629
 
                               (iFormat != ((ALbuffer*)(ALTHUNK_LOOKUPENTRY(buffers[i])))->format))
1630
 
                            {
1631
 
                                alSetError(AL_INVALID_OPERATION);
1632
 
                                bBuffersValid = AL_FALSE;
1633
 
                                break;
1634
 
                            }
1635
 
                        }
1636
 
                    }
1637
 
                }
1638
 
                else
 
1556
                ALbuffer *buffer;
 
1557
 
 
1558
                if(!alIsBuffer(buffers[i]))
1639
1559
                {
1640
1560
                    alSetError(AL_INVALID_NAME);
1641
1561
                    bBuffersValid = AL_FALSE;
1642
1562
                    break;
1643
1563
                }
 
1564
                if(!buffers[i])
 
1565
                    continue;
 
1566
 
 
1567
                buffer = (ALbuffer*)ALTHUNK_LOOKUPENTRY(buffers[i]);
 
1568
                if(iFrequency == -1 && iFormat == -1)
 
1569
                {
 
1570
                    iFrequency = buffer->frequency;
 
1571
                    iFormat = buffer->format;
 
1572
                }
 
1573
                else if(iFrequency != buffer->frequency ||
 
1574
                        iFormat != buffer->format)
 
1575
                {
 
1576
                    alSetError(AL_INVALID_OPERATION);
 
1577
                    bBuffersValid = AL_FALSE;
 
1578
                    break;
 
1579
                }
1644
1580
            }
1645
1581
 
1646
1582
            if(bBuffersValid)
1647
1583
            {
 
1584
                ALbuffer *buffer = NULL;
 
1585
 
1648
1586
                // Change Source Type
1649
1587
                ALSource->lSourceType = AL_STREAMING;
1650
1588
 
 
1589
                buffer = (ALbuffer*)ALTHUNK_LOOKUPENTRY(buffers[0]);
 
1590
 
1651
1591
                // All buffers are valid - so add them to the list
1652
1592
                ALBufferListStart = malloc(sizeof(ALbufferlistitem));
1653
 
                ALBufferListStart->buffer = buffers[0];
1654
 
                ALBufferListStart->bufferstate = PENDING;
1655
 
                ALBufferListStart->flag = 0;
 
1593
                ALBufferListStart->buffer = buffer;
1656
1594
                ALBufferListStart->next = NULL;
1657
1595
 
1658
1596
                // Increment reference counter for buffer
1659
 
                if(buffers[0])
1660
 
                    ((ALbuffer*)(ALTHUNK_LOOKUPENTRY(buffers[0])))->refcount++;
 
1597
                if(buffer) buffer->refcount++;
1661
1598
 
1662
1599
                ALBufferList = ALBufferListStart;
1663
1600
 
1664
1601
                for(i = 1; i < n; i++)
1665
1602
                {
 
1603
                    buffer = (ALbuffer*)ALTHUNK_LOOKUPENTRY(buffers[i]);
 
1604
 
1666
1605
                    ALBufferList->next = malloc(sizeof(ALbufferlistitem));
1667
 
                    ALBufferList->next->buffer = buffers[i];
1668
 
                    ALBufferList->next->bufferstate = PENDING;
1669
 
                    ALBufferList->next->flag = 0;
 
1606
                    ALBufferList->next->buffer = buffer;
1670
1607
                    ALBufferList->next->next = NULL;
1671
1608
 
1672
1609
                    // Increment reference counter for buffer
1673
 
                    if(buffers[i])
1674
 
                        ((ALbuffer*)(ALTHUNK_LOOKUPENTRY(buffers[i])))->refcount++;
 
1610
                    if(buffer) buffer->refcount++;
1675
1611
 
1676
1612
                    ALBufferList = ALBufferList->next;
1677
1613
                }
1680
1616
                {
1681
1617
                    ALSource->queue = ALBufferListStart;
1682
1618
                    // Update Current Buffer
1683
 
                    ALSource->ulBufferID = ALBufferListStart->buffer;
 
1619
                    ALSource->Buffer = ALBufferListStart->buffer;
1684
1620
                }
1685
1621
                else
1686
1622
                {
1720
1656
    ALsource *ALSource;
1721
1657
    ALsizei i;
1722
1658
    ALbufferlistitem *ALBufferList;
1723
 
    ALuint BufferID;
1724
1659
    ALboolean bBuffersProcessed;
1725
1660
 
1726
1661
    if (n == 0)
1735
1670
    {
1736
1671
        ALSource = (ALsource*)ALTHUNK_LOOKUPENTRY(source);
1737
1672
 
1738
 
        // Check that all 'n' buffers have been processed
1739
 
        ALBufferList = ALSource->queue;
1740
 
        for(i = 0; i < n; i++)
1741
 
        {
1742
 
            if(ALBufferList != NULL && ALBufferList->bufferstate == PROCESSED)
1743
 
            {
1744
 
                ALBufferList = ALBufferList->next;
1745
 
            }
1746
 
            else
1747
 
            {
1748
 
                bBuffersProcessed = AL_FALSE;
1749
 
                break;
1750
 
            }
1751
 
        }
1752
 
 
1753
1673
        // If all 'n' buffers have been processed, remove them from the queue
1754
 
        if(bBuffersProcessed)
 
1674
        if(!ALSource->bLooping && (ALuint)n <= ALSource->BuffersPlayed)
1755
1675
        {
1756
1676
            for(i = 0; i < n; i++)
1757
1677
            {
1759
1679
 
1760
1680
                ALSource->queue = ALBufferList->next;
1761
1681
                // Record name of buffer
1762
 
                buffers[i] = ALBufferList->buffer;
 
1682
                buffers[i] = ALBufferList->buffer->buffer;
1763
1683
                // Decrement buffer reference counter
1764
1684
                if(ALBufferList->buffer)
1765
 
                    ((ALbuffer*)(ALTHUNK_LOOKUPENTRY(ALBufferList->buffer)))->refcount--;
 
1685
                    ALBufferList->buffer->refcount--;
1766
1686
 
1767
1687
                // Release memory for buffer list item
1768
1688
                free(ALBufferList);
1771
1691
 
1772
1692
            if(ALSource->state != AL_PLAYING)
1773
1693
            {
1774
 
                if (ALSource->queue)
1775
 
                    BufferID = ALSource->queue->buffer;
 
1694
                if(ALSource->queue)
 
1695
                    ALSource->Buffer = ALSource->queue->buffer;
1776
1696
                else
1777
 
                    BufferID = 0;
1778
 
 
1779
 
                ALSource->ulBufferID = BufferID;
 
1697
                    ALSource->Buffer = NULL;
1780
1698
            }
1781
1699
 
1782
 
            if((ALuint)n > ALSource->BuffersPlayed)
1783
 
                ALSource->BuffersPlayed = 0;
1784
 
            else
1785
 
                ALSource->BuffersPlayed -= n;
 
1700
            ALSource->BuffersPlayed -= n;
1786
1701
        }
1787
1702
        else
1788
1703
        {
1836
1751
    pSource->state = AL_INITIAL;
1837
1752
    pSource->lSourceType = AL_UNDETERMINED;
1838
1753
 
1839
 
    pSource->ulBufferID= 0;
 
1754
    pSource->Buffer = NULL;
1840
1755
}
1841
1756
 
1842
1757
 
1856
1771
    ALenum        eOriginalFormat;
1857
1772
    ALboolean    bReturn = AL_TRUE;
1858
1773
    ALint        lTotalBufferDataSize;
 
1774
    ALuint       i;
1859
1775
 
1860
 
    if (((pSource->state == AL_PLAYING) || (pSource->state == AL_PAUSED)) && (pSource->ulBufferID))
 
1776
    if((pSource->state == AL_PLAYING || pSource->state == AL_PAUSED) && pSource->Buffer)
1861
1777
    {
1862
 
        pBuffer = ALTHUNK_LOOKUPENTRY(pSource->ulBufferID);
 
1778
        pBuffer = pSource->Buffer;
1863
1779
        // Get Current Buffer Size and frequency (in milliseconds)
1864
1780
        flBufferFreq = (ALfloat)pBuffer->frequency;
1865
1781
        eOriginalFormat = pBuffer->eOriginalFormat;
1869
1785
        readPos = pSource->position * lChannels * 2; // NOTE : This is the byte offset into the *current* buffer
1870
1786
        // Add byte length of any processed buffers in the queue
1871
1787
        pBufferList = pSource->queue;
1872
 
        while ((pBufferList) && (pBufferList->bufferstate == PROCESSED))
 
1788
        for(i = 0;i < pSource->BuffersPlayed && pBufferList;i++)
1873
1789
        {
1874
 
            readPos += ((ALbuffer*)ALTHUNK_LOOKUPENTRY(pBufferList->buffer))->size;
 
1790
            readPos += pBufferList->buffer->size;
1875
1791
            pBufferList = pBufferList->next;
1876
1792
        }
1877
1793
 
1885
1801
        while (pBufferList)
1886
1802
        {
1887
1803
            if (pBufferList->buffer)
1888
 
                lTotalBufferDataSize += ((ALbuffer*)ALTHUNK_LOOKUPENTRY(pBufferList->buffer))->size;
 
1804
                lTotalBufferDataSize += pBufferList->buffer->size;
1889
1805
            pBufferList = pBufferList->next;
1890
1806
        }
1891
1807
 
2004
1920
        pSource->BuffersPlayed = 0;
2005
1921
        while (pBufferList)
2006
1922
        {
2007
 
            pBuffer = ALTHUNK_LOOKUPENTRY(pBufferList->buffer);
 
1923
            pBuffer = pBufferList->buffer;
2008
1924
            lBufferSize = pBuffer ? pBuffer->size : 0;
2009
1925
 
2010
1926
            if ((lTotalBufferSize + lBufferSize) <= lByteOffset)
2011
1927
            {
2012
 
                // Offset is past this buffer so increment BuffersPlayed and if the Source is NOT looping
2013
 
                // update the state to PROCESSED
 
1928
                // Offset is past this buffer so increment BuffersPlayed
2014
1929
                pSource->BuffersPlayed++;
2015
 
 
2016
 
                if (!pSource->bLooping)
2017
 
                    pBufferList->bufferstate = PROCESSED;
2018
1930
            }
2019
1931
            else if (lTotalBufferSize <= lByteOffset)
2020
1932
            {
2021
1933
                // Offset is within this buffer
2022
 
                pBufferList->bufferstate = PENDING;
2023
 
 
2024
 
                // Set Current Buffer ID
2025
 
                pSource->ulBufferID = pBufferList->buffer;
 
1934
                // Set Current Buffer
 
1935
                pSource->Buffer = pBufferList->buffer;
2026
1936
 
2027
1937
                // SW Mixer Positions are in Samples
2028
1938
                pSource->position = (lByteOffset - lTotalBufferSize) /
2029
1939
                                    aluBytesFromFormat(pBuffer->format) /
2030
1940
                                    aluChannelsFromFormat(pBuffer->format);
2031
1941
            }
2032
 
            else
2033
 
            {
2034
 
                // Offset is before this buffer, so mark as pending
2035
 
                pBufferList->bufferstate = PENDING;
2036
 
            }
2037
1942
 
2038
1943
            // Increment the TotalBufferSize
2039
1944
            lTotalBufferSize += lBufferSize;
2075
1980
    {
2076
1981
        if (pBufferList->buffer)
2077
1982
        {
2078
 
            pBuffer = (ALbuffer*)ALTHUNK_LOOKUPENTRY(pBufferList->buffer);
 
1983
            pBuffer = pBufferList->buffer;
2079
1984
            break;
2080
1985
        }
2081
1986
        pBufferList = pBufferList->next;
2143
2048
        while (pBufferList)
2144
2049
        {
2145
2050
            if (pBufferList->buffer)
2146
 
                lTotalBufferDataSize += ((ALbuffer*)ALTHUNK_LOOKUPENTRY(pBufferList->buffer))->size;
 
2051
                lTotalBufferDataSize += pBufferList->buffer->size;
2147
2052
            pBufferList = pBufferList->next;
2148
2053
        }
2149
2054
 
2158
2063
 
2159
2064
ALvoid ReleaseALSources(ALCcontext *Context)
2160
2065
{
 
2066
    ALuint j;
 
2067
 
2161
2068
    while(Context->Source)
2162
2069
    {
2163
2070
        ALsource *temp = Context->Source;
2164
 
        Context->Source = Context->Source->next;
 
2071
        Context->Source = temp->next;
 
2072
 
 
2073
        // For each buffer in the source's queue, decrement its reference counter and remove it
 
2074
        while(temp->queue != NULL)
 
2075
        {
 
2076
            ALbufferlistitem *ALBufferList = temp->queue;
 
2077
            // Decrement buffer's reference counter
 
2078
            if(ALBufferList->buffer != NULL)
 
2079
                ALBufferList->buffer->refcount--;
 
2080
            // Update queue to point to next element in list
 
2081
            temp->queue = ALBufferList->next;
 
2082
            // Release memory allocated for buffer list item
 
2083
            free(ALBufferList);
 
2084
        }
 
2085
 
 
2086
        for(j = 0;j < MAX_SENDS;++j)
 
2087
        {
 
2088
            if(temp->Send[j].Slot)
 
2089
                temp->Send[j].Slot->refcount--;
 
2090
        }
2165
2091
 
2166
2092
        // Release source structure
2167
2093
        ALTHUNK_REMOVEENTRY(temp->source);