libsaria: Change meaning of audio::seek_to()
It used to seek to a percentage of the pipeline, but now is seeks to an absolute position in nanoseconds.
This commit is contained in:
parent
6b58311e9e
commit
c1332133a9
|
@ -23,7 +23,7 @@ namespace libsaria
|
||||||
|
|
||||||
/* Position related functions */
|
/* Position related functions */
|
||||||
bool seek(int);
|
bool seek(int);
|
||||||
bool seek_to(double);
|
void seek_to(double);
|
||||||
gint64 duration();
|
gint64 duration();
|
||||||
gint64 position();
|
gint64 position();
|
||||||
string posstr();
|
string posstr();
|
||||||
|
|
|
@ -24,19 +24,12 @@ static bool get_position(gint64 &position)
|
||||||
namespace libsaria
|
namespace libsaria
|
||||||
{
|
{
|
||||||
|
|
||||||
bool audio::seek_to(double prcnt)
|
void audio::seek_to(double pos)
|
||||||
{
|
{
|
||||||
bool ret;
|
gst_element_seek_simple(GST_ELEMENT(get_player()),
|
||||||
gint64 duration;
|
GST_FORMAT_TIME,
|
||||||
|
GST_SEEK_FLAG_FLUSH,
|
||||||
ret = get_duration(duration);
|
pos);
|
||||||
if (ret == true) {
|
|
||||||
gst_element_seek_simple(GST_ELEMENT(get_player()),
|
|
||||||
GST_FORMAT_TIME,
|
|
||||||
GST_SEEK_FLAG_FLUSH,
|
|
||||||
duration * prcnt);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Use to seek forward or backward in a song */
|
/* Use to seek forward or backward in a song */
|
||||||
|
|
Loading…
Reference in New Issue