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:
Anna Schumaker 2015-03-05 11:22:18 -05:00 committed by Anna Schumaker
parent 657ce8f0f4
commit ec4d3b945e
4 changed files with 5 additions and 5 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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.

View File

@ -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; }
}; };