Re: [mpg123-devel] Code example of mpg123_index and mpg123_set_index
Brought to you by:
sobukus
From: Thomas O. <tho...@or...> - 2018-09-25 10:57:41
|
Am Tue, 25 Sep 2018 11:30:18 +0200 schrieb "s.baus86" <s.b...@gm...>: > Thanks for your mail. How should the array be initialised? The argument to mpg123_index() is just a pointer without associated memory. You get the size of the associated memory via fill. Of course, when re-reading the index for handing it to mpg123_set_index(), you need to allocate fill elements of the correct type and then store the values there. > Sorry for asking, but I'm not that familiar with C. You need some understanding of C with pointers and data types. If in doubt, try to read a bit more, the net is ripe with tutorials and examples. > int[] indexArray = new int[100]?! Or is it that simple? If 100 is the number of elements, not some arbitrary fixed value, this sounds about right for C++ (I'd write int* instead of int[]) except for the fact that int is not the correct type. It is off_t. That an be identical to int, but mostly will not be. Alrighty then, Thomas |