Clamp audio seek to non-zero timestamp

Seeking first seeks the video source, then uses the 'resolved' seek
position for video to seek the audio source. If an edit list is handled
by prerolling from a preceding keyframe in the video track, this can
lead to negative resolve seek positions from video, and seeks to
negative values are ignored.

Clamp the resolved seek position from the video source to be
non-negative so that the seek is not ignored. This fixes looping for
files with edit lists that require prerolling from before zero, though
video rendering needs to catch up after looping back to zero.

Bug: 156762034
Test: Manually verified using the APK in b/156762034#comment1
Change-Id: I59753b36d0f1272d4a7b4292b5edd787f9575dfa
diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.cpp b/media/libmediaplayerservice/nuplayer/GenericSource.cpp
index 0eaa503..e6bb2e1 100644
--- a/media/libmediaplayerservice/nuplayer/GenericSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/GenericSource.cpp
@@ -1159,7 +1159,7 @@
         readBuffer(MEDIA_TRACK_TYPE_VIDEO, seekTimeUs, mode, &actualTimeUs);
 
         if (mode != MediaPlayerSeekMode::SEEK_CLOSEST) {
-            seekTimeUs = actualTimeUs;
+            seekTimeUs = std::max<int64_t>(0, actualTimeUs);
         }
         mVideoLastDequeueTimeUs = actualTimeUs;
     }