Re: [mpg123-devel] Monitor and cancel stream scanning
Brought to you by:
sobukus
From: Olivier G. <li...@sa...> - 2010-09-09 13:35:22
|
On 09/09/2010 03:02 PM, Thomas Orgis wrote: > Am Thu, 09 Sep 2010 13:10:27 +0200 > schrieb Olivier Guilyardi <li...@sa...>: > >> Therefore, I need a way 1. to monitor the scanning progress, 2. to cancel it if >> needed. And AFAICS, mpg123_scan() doesn't allow this, it will block until it's >> done, and there's no way to display some progress status. > > As you already noted, scanning happens implicitly when decoding or seeking (when fuzzy seek is not enabled). So, why not just do something along a loop over mpg123_seek(mh, 441000, SEEK_CUR), and detect the end (reached position does not increase anymore)? That's perfect indeed. I have another question: if I want to cache/restore the result of scanning, are mpg123_index() and mpg123_set_index() sufficient? I'm unsure about this after having looked at the SEEK_END case in mpg123_seek() definition. Thanks -- Olivier |