Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 28887 | Differences between
and this patch

Collapse All | Expand All

(-)kioslave/audiocd/audiocd.cpp (-36 / +49 lines)
Lines 1516-1558 Link Here
1516
          buffer[1][i]=buf[2*i+1]/32768.0;
1516
          buffer[1][i]=buf[2*i+1]/32768.0;
1517
        }
1517
        }
1518
1518
1519
        /* process chunk of data */
1519
        vorbis_analysis_wrote(&d->vd,i);
1520
        vorbis_analysis_wrote(&d->vd,i);
1520
1521
        processed += flush_vorbis();
1521
        while(vorbis_analysis_blockout(&d->vd,&d->vb)==1) {
1522
/* Support ancient libvorbis (< RC3).  */
1523
#if HAVE_VORBIS >= 2
1524
	  vorbis_analysis(&d->vb,NULL);
1525
          /* Non-ancient case.  */
1526
          vorbis_bitrate_addblock(&d->vb);
1527
1528
          while(vorbis_bitrate_flushpacket(&d->vd, &d->op)) {
1529
#else
1530
          vorbis_analysis(&d->vb,&d->op);
1531
          /* Make a lexical block to place the #ifdef's nearby.  */
1532
          if (1) {
1533
#endif
1534
          ogg_stream_packetin(&d->os,&d->op);
1535
1536
          while(int result=ogg_stream_pageout(&d->os,&d->og)) {
1537
1538
            if (!result) break;
1539
1540
            QByteArray output;
1541
1542
            char * oggheader = reinterpret_cast<char *>(d->og.header);
1543
            char * oggbody = reinterpret_cast<char *>(d->og.body);
1544
1545
	    output.setRawData(oggheader, d->og.header_len);
1546
            data(output);
1547
            output.resetRawData(oggheader, d->og.header_len);
1548
	   
1549
            output.setRawData(oggbody, d->og.body_len);
1550
            data(output);
1551
            output.resetRawData(oggbody, d->og.body_len);
1552
	    processed +=  d->og.header_len + d->og.body_len;
1553
          }
1554
        }
1555
      }
1556
      }
1522
      }
1557
#endif
1523
#endif
1558
1524
Lines 1596-1601 Link Here
1596
1562
1597
#ifdef HAVE_VORBIS
1563
#ifdef HAVE_VORBIS
1598
  if (filetype == "ogg") {
1564
  if (filetype == "ogg") {
1565
    // send end-of-stream and flush the encoder
1566
    vorbis_analysis_wrote(&d->vd,0);
1567
    processed += flush_vorbis();
1599
    ogg_stream_clear(&d->os);
1568
    ogg_stream_clear(&d->os);
1600
    vorbis_block_clear(&d->vb);
1569
    vorbis_block_clear(&d->vb);
1601
    vorbis_dsp_clear(&d->vd);
1570
    vorbis_dsp_clear(&d->vd);
Lines 1788-1791 Link Here
1788
  // Not yet.
1757
  // Not yet.
1789
}
1758
}
1790
1759
1760
#ifdef HAVE_VORBIS
1761
long AudioCDProtocol::flush_vorbis(void)
1762
{
1763
  long processed(0);
1764
1765
  while(vorbis_analysis_blockout(&d->vd,&d->vb)==1) {
1766
    /* Support ancient libvorbis (< RC3).  */
1767
#if HAVE_VORBIS >= 2
1768
    vorbis_analysis(&d->vb,NULL);
1769
    /* Non-ancient case.  */
1770
    vorbis_bitrate_addblock(&d->vb);
1771
1772
    while(vorbis_bitrate_flushpacket(&d->vd, &d->op)) {
1773
#else
1774
      vorbis_analysis(&d->vb,&d->op);
1775
      /* Make a lexical block to place the #ifdef's nearby.  */
1776
      if (1) {
1777
#endif
1778
        ogg_stream_packetin(&d->os,&d->op);
1779
1780
	while(int result=ogg_stream_pageout(&d->os,&d->og)) {
1781
1782
          if (!result) break;
1783
1784
	  QByteArray output;
1785
1786
	  char * oggheader = reinterpret_cast<char *>(d->og.header);
1787
	  char * oggbody = reinterpret_cast<char *>(d->og.body);
1788
1789
	  output.setRawData(oggheader, d->og.header_len);
1790
	  data(output);
1791
	  output.resetRawData(oggheader, d->og.header_len);
1792
	   
1793
	  output.setRawData(oggbody, d->og.body_len);
1794
	  data(output);
1795
	  output.resetRawData(oggbody, d->og.body_len);
1796
	  processed +=  d->og.header_len + d->og.body_len;
1797
	}
1798
      }
1799
    }
1800
    return processed;
1801
  }
1802
#endif
1803
1791
// vim:ts=2:sw=2:tw=78:et:
1804
// vim:ts=2:sw=2:tw=78:et:
(-)kioslave/audiocd/audiocd.h (+1 lines)
Lines 96-101 Link Here
96
#endif
96
#endif
97
#ifdef HAVE_VORBIS
97
#ifdef HAVE_VORBIS
98
    long vorbisSize(long time_secs);
98
    long vorbisSize(long time_secs);
99
    long flush_vorbis(void);
99
#endif
100
#endif
100
};
101
};
101
102

Return to bug 28887