Handle mp4 file with abnormal pcm audio playback stuck
When we play the mp4 file whose pcm audio's sample size of stsz box
is not correct, it will stuck. The root cause is it may take wrong
buffer to pcm decoder, and AudioTrack might not be able to play the
decoded pcm data and cannot get right timestamp, so video will stuck
by audio.
Bug: 132042434
Test: test with the mp4 file whose pcm audio sampleSize is abnormal
and check if the video can be played normally.
Change-Id: I06c69e43922512f43d996fafcbe8b9c23ce3e7dd
diff --git a/media/extractors/mp4/SampleTable.h b/media/extractors/mp4/SampleTable.h
index 57f6e62..076f4c3 100644
--- a/media/extractors/mp4/SampleTable.h
+++ b/media/extractors/mp4/SampleTable.h
@@ -89,6 +89,10 @@
status_t findThumbnailSample(uint32_t *sample_index);
+ void setPredictSampleSize(uint32_t sampleSize) {
+ mDefaultSampleSize = sampleSize;
+ }
+
protected:
~SampleTable();