Tuner HAL Fix bug allowing only one MediaEvent
Currently, our startMediaFilterHandler returns on the first
time it successfully creates a MediaEvent. This does not
match the intended behavior, which is that all of its
current output is read and turned into events, and then
cleared.
Bug: 238797398
Test: Manually with Cuttlefish and SampleTunerTvInput.
Before change, any input type except ES will only create a
single MediaEvent. After change, full input will be handled
properly.
Change-Id: I856385cdf8ebb3a7d3fb0f864085123ec6c172b9
diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp
index 4d48c04..d3c98f2 100644
--- a/tv/tuner/aidl/default/Filter.cpp
+++ b/tv/tuner/aidl/default/Filter.cpp
@@ -900,7 +900,8 @@
}
result = createMediaFilterEventWithIon(mPesOutput);
- if (result.isOk()) {
+ if (!result.isOk()) {
+ mFilterOutput.clear();
return result;
}
}