Mercurial > hg > forks > bilotrip-mj12
view liboggplayer-src/src/util.cpp @ 60:9c63b355c82b
Remove the audio code completely.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 06 Aug 2013 23:45:05 +0300 |
parents | 74b28a572438 |
children |
line wrap: on
line source
#include "imp.hpp" #ifdef _WINDOWS #include <windows.h> #endif int OggPlayer::Imp::queue_page(ogg_page * page) { if (theora_p) ogg_stream_pagein(&o_tsstate, page); return 0; } bool OggPlayer::Imp::buffer_data() { if (!file_in.is_open()) return 0; if (file_in.eof()) { file_in.close(); return 0; } char *buffer = ogg_sync_buffer(&o_sync, 4096); int bytes = file_in.read(buffer, 4096).gcount(); ogg_sync_wrote(&o_sync, bytes); return (bytes != 0); } double OggPlayer::Imp::get_time() { double now = time_factor*timer.elapsed(); return now; }