Mercurial > hg > forks > bilotrip-mj12
diff liboggplayer-src/src/open_close.cpp @ 14:083c73ceb716
Get rid of the vorbis related code.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 05 Aug 2013 16:54:46 +0300 |
parents | 3b6cea0d1980 |
children | 9c63b355c82b |
line wrap: on
line diff
--- a/liboggplayer-src/src/open_close.cpp Mon Aug 05 16:47:07 2013 +0300 +++ b/liboggplayer-src/src/open_close.cpp Mon Aug 05 16:54:46 2013 +0300 @@ -3,6 +3,7 @@ void OggPlayer::Imp::close() { if(!need_close) return; +#ifdef VORBIS_SUPPORT if (vorbis_p) { ogg_stream_clear(&o_vsstate); vorbis_block_clear(&v_block); @@ -10,6 +11,7 @@ } vorbis_comment_clear(&v_comment); vorbis_info_clear(&v_info); +#endif if (theora_p) { ogg_stream_clear(&o_tsstate); @@ -52,12 +54,16 @@ /* it is theora */ memcpy(&o_tsstate, &test, sizeof(test)); theora_p = 1; - } else if (!vorbis_p && vorbis_synthesis_headerin(&v_info, + } else +#ifdef VORBIS_SUPPORT + if (!vorbis_p && vorbis_synthesis_headerin(&v_info, &v_comment, &o_packet) >= 0) { /* it is vorbis */ memcpy(&o_vsstate, &test, sizeof(test)); vorbis_p = 1; - } else { + } else +#endif + { /* whatever it is, we don't care about it */ ogg_stream_clear(&test); } @@ -65,7 +71,11 @@ } // we're expecting more header packets. - while ((theora_p && theora_p < 3) || (vorbis_p && vorbis_p < 3)) { + while ((theora_p && theora_p < 3) +#ifdef VORBIS_SUPPORT + || (vorbis_p && vorbis_p < 3) +#endif + ) { int ret; // look for further theora headers @@ -82,6 +92,7 @@ theora_p++; } +#ifdef VORBIS_SUPPORT // look for more vorbis header packets while (vorbis_p && (vorbis_p < 3) && (ret = ogg_stream_packetout( &o_vsstate, &o_packet))) { @@ -97,6 +108,7 @@ if (vorbis_p == 3) break; } +#endif // The header pages/packets will arrive before anything else we // care about, or the stream is not obeying spec @@ -127,7 +139,7 @@ fprintf(stderr, "DDD: 0\n"); return false; } -#if 0 +#ifdef VORBIS_SUPPORT if (vorbis_p) { vorbis_synthesis_init(&v_state, &v_info); vorbis_block_init(&v_state, &v_block); @@ -158,8 +170,10 @@ // 2) init some structs ogg_sync_init(&o_sync); +#ifdef VORBIS_SUPPORT vorbis_info_init(&v_info); vorbis_comment_init(&v_comment); +#endif theora_info_init(&t_info); theora_comment_init(&t_comment); @@ -179,15 +193,17 @@ if (failbit) { theora_info_clear(&t_info); theora_comment_clear(&t_comment); +#ifdef VORBIS_SUPPORT vorbis_info_clear(&v_info); vorbis_comment_clear(&v_comment); +#endif ogg_sync_clear(&o_sync); file_in.close(); fprintf(stderr, "XXX: done\n"); return; } -#if 0 +#ifdef VORBIS_SUPPORT // 5) init audio conversion int ret = SDL_BuildAudioCVT(&cvt, AUDIO_S16, v_info.channels, v_info.rate, audio_format, channels, rate);