summaryrefslogtreecommitdiff
path: root/media
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-05-26 21:23:06 +0000
committerMoonchild <moonchild@palemoon.org>2022-05-26 21:23:06 +0000
commit84c7d3c2f682d68351ed25005f915161b4e5c870 (patch)
treea998e062ac1664a38ee091836b11ed1309256d42 /media
parentc772d0ef215ebba8feaa5813e1aac9863dbaea9c (diff)
downloaduxp-84c7d3c2f682d68351ed25005f915161b4e5c870.tar.gz
No issue - relax ctts flag checking in media/libstagefright
Some encoders will set ctts flags incorrectly (similar to version) resulting in libstagefright aborting playback of media based on the media header. (Looking at you, Twitter) This change relaxes libstagefright's checking to pass ctts flags 0 or 1 and falls through to actually trying to decoding the file.
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp b/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp
index bc991e8e12..7d3a8f7dac 100644
--- a/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp
+++ b/media/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;
}