Support nonblocking reads for secure source (video)
Bug: 15699665 Change-Id: If67c3196b42b24333ace1373711dc3f4eb30f0da
This commit is contained in:
@@ -222,7 +222,7 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
|||||||
int retryLimit = 500; // Limit on number of retries before timeout, 10ms per retry
|
int retryLimit = 500; // Limit on number of retries before timeout, 10ms per retry
|
||||||
|
|
||||||
ReadOptions::SeekMode mode;
|
ReadOptions::SeekMode mode;
|
||||||
if (options && options->getSeekTo(&seekTimeUs, &mode)) {
|
if (options != NULL && options->getSeekTo(&seekTimeUs, &mode)) {
|
||||||
|
|
||||||
// When doing a seek, use a longer timeout since we need to set up a new connection
|
// When doing a seek, use a longer timeout since we need to set up a new connection
|
||||||
retryLimit = 1500;
|
retryLimit = 1500;
|
||||||
@@ -258,9 +258,10 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaBuffer *mediaBuf;
|
MediaBuffer *mediaBuf = NULL;
|
||||||
|
|
||||||
status_t err = mGroup->acquire_buffer(&mediaBuf);
|
status_t err = mGroup->acquire_buffer(
|
||||||
|
&mediaBuf, options != NULL && options->getNonBlocking());
|
||||||
|
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
CHECK(mediaBuf == NULL);
|
CHECK(mediaBuf == NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user