Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-04-15 15:14:52 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2016-04-15 15:14:52 +0300
commitec5a4156c9bb9d9855800dba0f5f42396850f67d (patch)
treeb0ec5610d21802b8e48a1963efa34816431bb3de /demuxer
parent31f2c7d4477a7824567fc0ea70f1d7c24c9a041b (diff)
Parse the forced flag from the mov tx3g subtitle atom
Diffstat (limited to 'demuxer')
-rw-r--r--demuxer/Demuxers/LAVFStreamInfo.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/demuxer/Demuxers/LAVFStreamInfo.cpp b/demuxer/Demuxers/LAVFStreamInfo.cpp
index 59eded53..cf3fda75 100644
--- a/demuxer/Demuxers/LAVFStreamInfo.cpp
+++ b/demuxer/Demuxers/LAVFStreamInfo.cpp
@@ -477,6 +477,15 @@ STDMETHODIMP CLAVFStreamInfo::CreateSubtitleMediaType(AVFormatContext *avctx, AV
mtype.formattype = FORMAT_SubtitleInfo;
int extra = avstream->codec->extradata_size;
+
+ // parse flags from mov tx3g atom
+ if (avstream->codec->codec_id == AV_CODEC_ID_MOV_TEXT && avstream->codec->codec_tag == MKTAG('t', 'x', '3', 'g') && extra >= 4)
+ {
+ uint32_t flags = AV_RB32(avstream->codec->extradata);
+ if (flags & 0x80000000)
+ avstream->disposition |= AV_DISPOSITION_FORCED;
+ }
+
if (avstream->codec->codec_id == AV_CODEC_ID_MOV_TEXT || avstream->codec->codec_id == AV_CODEC_ID_TEXT || avstream->codec->codec_id == AV_CODEC_ID_SUBRIP) {
extra = 0;
}