trust ogg decoder more, fewer debugger calls

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5765 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shatty
2003-12-26 18:44:06 +00:00
parent 77ae533d3c
commit b6a3f35ba0
2 changed files with 4 additions and 8 deletions
@@ -213,8 +213,8 @@ oggReader::GetStreamInfo(void *cookie, int64 *frameCount, bigtime_t *duration,
TRACE("oggReader::GetStreamInfo\n");
ogg_stream_state * stream = static_cast<ogg_stream_state *>(cookie);
memset(format, 0, sizeof(*format));
*frameCount = -1; // don't know
*duration = -1; // don't know
*frameCount = 1024*1024; // don't know
*duration = 1024*1024; // don't know
ogg_packet * packet = &fInitialHeaderPackets[stream->serialno];
*infoBuffer = (void*)packet;
*infoSize = sizeof(ogg_packet);
@@ -246,8 +246,7 @@ oggReader::GetNextChunk(void *cookie,
void **chunkBuffer, int32 *chunkSize,
media_header *mediaHeader)
{
TRACE("oggReader::GetNextChunk");
debugger("oggReader::GetNextChunk");
TRACE("oggReader::GetNextChunk\n");
ogg_stream_state * stream = static_cast<ogg_stream_state *>(cookie);
while (ogg_stream_packetpeek(stream,NULL) != 1) {
ogg_page page;
@@ -33,7 +33,6 @@ vorbisDecoder::vorbisDecoder()
vorbisDecoder::~vorbisDecoder()
{
debugger("vorbisDecoder::~vorbisDecoder");
TRACE("vorbisDecoder::~vorbisDecoder\n");
delete [] fDecodeBuffer;
}
@@ -43,8 +42,6 @@ status_t
vorbisDecoder::Setup(media_format *ioEncodedFormat,
const void *infoBuffer, int32 infoSize)
{
debugger("vorbisDecoder::Setup");
TRACE("vorbisDecoder::Setup\n");
if ((ioEncodedFormat->type != B_MEDIA_UNKNOWN_TYPE)
&& (ioEncodedFormat->type != B_MEDIA_ENCODED_AUDIO)) {
TRACE("vorbisDecoder::Setup not called with audio/unknown stream: not vorbis");
@@ -85,6 +82,7 @@ vorbisDecoder::Setup(media_format *ioEncodedFormat,
// initialize decoder
vorbis_synthesis_init(&fDspState,&fInfo);
vorbis_block_init(&fDspState,&fBlock);
ioEncodedFormat->type = B_MEDIA_ENCODED_AUDIO;
return B_OK;
}
@@ -96,7 +94,6 @@ size_t get_audio_buffer_size(const media_raw_audio_format & raf) {
status_t
vorbisDecoder::NegotiateOutputFormat(media_format *ioDecodedFormat)
{
debugger("vorbisDecoder::NegotiateOutputFormat");
TRACE("vorbisDecoder::NegotiateOutputFormat\n");
// BeBook says: The codec will find and return in ioFormat its best matching format
// => This means, we never return an error, and always change the format values