diff options
author | Matt A. Tobin <email@mattatobin.com> | 2022-05-27 16:26:27 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2022-05-27 16:26:27 -0500 |
commit | 5310bcfbad6c8687d0bdbe5e49fb73858dcc1631 (patch) | |
tree | a594b4b50e071c36fe8cf3d70c877d7ad6e1ce9d | |
parent | dd57f07e934053aa863c231ae0a5c0cd7c8976d8 (diff) | |
download | aura-central-5310bcfbad6c8687d0bdbe5e49fb73858dcc1631.tar.gz |
[Libs:StageFright] Relax ctts flag checking
- Some encoders will set ctts flags incorrectly (similar to version) resulting in libstagefright aborting playback of media based on the media header.
- This change relaxes libstagefright's checking to pass ctts flags 0 or 1 and falls through to actually trying to decoding the file.
-rw-r--r-- | libs/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp b/libs/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp index bc991e8e1..7d3a8f7da 100644 --- a/libs/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp +++ b/libs/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp @@ -385,6 +385,7 @@ status_t SampleTable::setTimeToSampleParams( // contains signed values, however some software creates version 0 files that // contain signed values, so we're always treating the values as signed, // regardless of version. +// We do the same with ctts flags to work around encoder software issues. status_t SampleTable::setCompositionTimeToSampleParams( off64_t data_offset, size_t data_size) { ALOGV("There are reordered frames present."); @@ -406,8 +407,8 @@ status_t SampleTable::setCompositionTimeToSampleParams( uint32_t version = flags >> 24; flags &= 0xffffff; - if ((version != 0 && version != 1) || flags != 0) { - // Expected version = 0 or 1, flags = 0. + if ((version != 0 && version != 1) || (flags != 0 && flags != 1)) { + // Expected version = 0 or 1, flags = 0 or 1. return ERROR_MALFORMED; } |