~ubuntu-branches/ubuntu/gutsy/audacity/gutsy

« back to all changes in this revision

Viewing changes to lib-src/libsndfile/src/wav.c

  • Committer: Bazaar Package Importer
  • Author(s): Free Ekanayaka
  • Date: 2007-05-18 12:11:05 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070518121105-onhr7ojai3n5khzt
Tags: 1.3.3-1
* New upstream release
* Added watch file
* debian/patches:
   - updated libmp3lame patch
* debian/control:
   - as suggested upstream, depend on libgtk2.0-dev, otherwise 
     the code fails to build

Show diffs side-by-side

added added

removed removed

Lines of Context:
1555
1555
        return 0 ;
1556
1556
} /* wav_read_acid_chunk */
1557
1557
 
 
1558
#if 0
 
1559
/* LLL
 
1560
|| This is the original 1.16 function.  It was replaced with the 1.18
 
1561
|| function to correct a critter when dealing with coding history.
 
1562
*/
1558
1563
int
1559
1564
wav_read_bext_chunk (SF_PRIVATE *psf, unsigned int chunksize)
1560
1565
{
1594
1599
 
1595
1600
        return 0 ;
1596
1601
} /* wav_read_bext_chunk */
 
1602
#endif
 
1603
 
 
1604
int
 
1605
wav_read_bext_chunk (SF_PRIVATE *psf, unsigned int chunksize)
 
1606
{
 
1607
        SF_BROADCAST_INFO* b ;
 
1608
        unsigned int bytes = 0 ;
 
1609
 
 
1610
        if ((psf->broadcast_info = calloc (1, sizeof (SF_BROADCAST_INFO))) == NULL)
 
1611
        {       psf->error = SFE_MALLOC_FAILED ;
 
1612
                return psf->error ;
 
1613
                } ;
 
1614
 
 
1615
        b = psf->broadcast_info ;
 
1616
 
 
1617
        bytes += psf_binheader_readf (psf, "b", b->description, sizeof (b->description)) ;
 
1618
        bytes += psf_binheader_readf (psf, "b", b->originator, sizeof (b->originator)) ;
 
1619
        bytes += psf_binheader_readf (psf, "b", b->originator_reference, sizeof (b->originator_reference)) ;
 
1620
        bytes += psf_binheader_readf (psf, "b", b->origination_date, sizeof (b->origination_date)) ;
 
1621
        bytes += psf_binheader_readf (psf, "b", b->origination_time, sizeof (b->origination_time)) ;
 
1622
        bytes += psf_binheader_readf (psf, "442", &b->time_reference_low, &b->time_reference_high, &b->version) ;
 
1623
        bytes += psf_binheader_readf (psf, "bj", &b->umid, sizeof (b->umid), 190) ;
 
1624
 
 
1625
        if (chunksize > WAV_BEXT_CHUNK_SIZE)
 
1626
        {       /* File has coding history data. */
 
1627
 
 
1628
                b->coding_history_size = chunksize - WAV_BEXT_CHUNK_SIZE ;
 
1629
 
 
1630
                if (b->coding_history_size > SIGNED_SIZEOF (b->coding_history))
 
1631
                        b->coding_history_size = SIGNED_SIZEOF (b->coding_history) ;
 
1632
 
 
1633
                /* We do not parse the coding history */
 
1634
                bytes += psf_binheader_readf (psf, "b", b->coding_history, b->coding_history_size) ;
 
1635
                b->coding_history [sizeof (b->coding_history) - 1] = 0 ;
 
1636
                } ;
 
1637
 
 
1638
        if (bytes < chunksize)
 
1639
                psf_binheader_readf (psf, "j", chunksize - bytes) ;
 
1640
 
 
1641
        return 0 ;
 
1642
} /* wav_read_bext_chunk */
1597
1643
 
1598
1644
static int
1599
1645
wav_write_bext_chunk (SF_PRIVATE *psf)