audio: Fix seeking on ARM
The on_seek() function needs to take an int64_t to avoid truncating on ARM. Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
This commit is contained in:
parent
657ce8f0f4
commit
ec4d3b945e
|
@ -100,7 +100,7 @@ void audio :: pause()
|
||||||
cur_driver->pause();
|
cur_driver->pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
void audio :: seek_to(long pos)
|
void audio :: seek_to(int64_t pos)
|
||||||
{
|
{
|
||||||
if (cur_track)
|
if (cur_track)
|
||||||
cur_driver->seek_to(pos);
|
cur_driver->seek_to(pos);
|
||||||
|
|
|
@ -97,7 +97,7 @@ public:
|
||||||
return state == GST_STATE_PLAYING;
|
return state == GST_STATE_PLAYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
void seek_to(long offset)
|
void seek_to(int64_t offset)
|
||||||
{
|
{
|
||||||
gst_element_seek_simple(gst_player,
|
gst_element_seek_simple(gst_player,
|
||||||
GST_FORMAT_TIME,
|
GST_FORMAT_TIME,
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param offset Position from the beginning of the track where we will seek to, in nanoseconds.
|
* @param offset Position from the beginning of the track where we will seek to, in nanoseconds.
|
||||||
*/
|
*/
|
||||||
virtual void seek_to(long offset) = 0;
|
virtual void seek_to(int64_t offset) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the current position of the playback.
|
* Return the current position of the playback.
|
||||||
|
@ -91,7 +91,7 @@ namespace audio
|
||||||
*
|
*
|
||||||
* @param pos Offset (in nanoseconds) from the beginning of the track.
|
* @param pos Offset (in nanoseconds) from the beginning of the track.
|
||||||
*/
|
*/
|
||||||
void seek_to(long);
|
void seek_to(int64_t);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop playback and seek to the beginning of the track.
|
* Stop playback and seek to the beginning of the track.
|
||||||
|
|
|
@ -32,7 +32,7 @@ public:
|
||||||
|
|
||||||
bool is_playing() { return playing; }
|
bool is_playing() { return playing; }
|
||||||
|
|
||||||
void seek_to(long offset) { cur_pos = offset; }
|
void seek_to(int64_t offset) { cur_pos = offset; }
|
||||||
int64_t position() { return cur_pos; }
|
int64_t position() { return cur_pos; }
|
||||||
int64_t duration() { return cur_duration; }
|
int64_t duration() { return cur_duration; }
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue