diff options
author | Markus Pfau <pfau@peak3d.de> | 2018-12-14 09:36:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-14 09:36:47 +0100 |
commit | 4c17e7769e5af6817e0c405438a36e5a552b21d9 (patch) | |
tree | 0322800371abceda78cafe8343b96807672cdf50 | |
parent | 57abba2fd5231595d3a632b4e9c566b9fbd99d02 (diff) | |
parent | f2b8077ed735326f77c2c74c6878b6c9a6d310e8 (diff) |
Merge pull request #15056 from peak3d/mpeg4
[Android] remove mpeg4 HD restriction / use dts for unknown pts for mpeg4
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp | 7 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp index c93409cfae..b6d6c92c4b 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp @@ -344,6 +344,7 @@ CDVDVideoCodecAndroidMediaCodec::CDVDVideoCodecAndroidMediaCodec(CProcessInfo &p , m_bitstream(nullptr) , m_render_surface(surface_render) , m_mpeg2_sequence(nullptr) +, m_useDTSforPTS(false) { m_videobuffer.Reset(); } @@ -418,6 +419,7 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio m_hints = hints; m_indexInputBuffer = -1; m_dtsShift = DVD_NOPTS_VALUE; + m_useDTSforPTS = false; CLog::Log(LOGDEBUG, LOGVIDEO, "CDVDVideoCodecAndroidMediaCodec::Open hints: fpsrate %d / fpsscale %d\n", m_hints.fpsrate, m_hints.fpsscale); CLog::Log(LOGDEBUG, LOGVIDEO, "CDVDVideoCodecAndroidMediaCodec::Open hints: CodecID %d \n", m_hints.codec); @@ -441,10 +443,9 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio m_formatname = "amc-mpeg2"; break; case AV_CODEC_ID_MPEG4: - if (hints.width <= 800) - goto FAIL; m_mime = "video/mp4v-es"; m_formatname = "amc-mpeg4"; + m_useDTSforPTS = true; break; case AV_CODEC_ID_H263: m_mime = "video/3gpp"; @@ -906,6 +907,8 @@ bool CDVDVideoCodecAndroidMediaCodec::AddData(const DemuxPacket &packet) int64_t presentationTimeUs = 0; if (pts != DVD_NOPTS_VALUE) presentationTimeUs = (pts - m_dtsShift); + else if (m_useDTSforPTS && dts != DVD_NOPTS_VALUE) + presentationTimeUs = (dts - m_dtsShift); int flags = 0; int offset = 0; diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h index acfda364c0..b1577bb455 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h @@ -183,6 +183,7 @@ protected: mpeg2_sequence *m_mpeg2_sequence; int m_src_offset[4]; int m_src_stride[4]; + bool m_useDTSforPTS; // CJNISurfaceHolderCallback interface public: |