diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-04-15 15:14:52 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-04-15 15:14:52 +0300 |
commit | ec5a4156c9bb9d9855800dba0f5f42396850f67d (patch) | |
tree | b0ec5610d21802b8e48a1963efa34816431bb3de /demuxer | |
parent | 31f2c7d4477a7824567fc0ea70f1d7c24c9a041b (diff) |
Parse the forced flag from the mov tx3g subtitle atom
Diffstat (limited to 'demuxer')
-rw-r--r-- | demuxer/Demuxers/LAVFStreamInfo.cpp | 9 |
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; } |