Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08167e2a authored by Thomas Wendt's avatar Thomas Wendt
Browse files

libnbaio: Don't call get_presentation_position for pre KitKat blobs

This fixes a crash with the HTC Tegra3 audio blob where
mStream->get_presentation_position is not NULL but pointing to a unknown
position in memory.

Change-Id: I0ff0ab064c1ac16a128bb3f24d4a473b3164f36d
parent 5f0d9235
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ status_t AudioStreamOutSink::getNextWriteTimestamp(int64_t *timestamp) {
#endif
}

#ifndef HAVE_PRE_KITKAT_AUDIO_BLOB
status_t AudioStreamOutSink::getTimestamp(AudioTimestamp& timestamp)
{
    if (mStream->get_presentation_position == NULL) {
@@ -96,5 +97,6 @@ status_t AudioStreamOutSink::getTimestamp(AudioTimestamp& timestamp)
    timestamp.mPosition = position64;
    return OK;
}
#endif

}   // namespace android