xbmc: add backported patches to fix ASS/SSA subtitles with ffmpeg-2.4, this fixes non working or corrupted subtitles

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2014-09-28 01:24:49 +02:00
parent 19043dfe1d
commit e6751e4b2e
2 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,36 @@
From 60a8b445efe08c20d60c58fd54a18348bf00024c Mon Sep 17 00:00:00 2001
From: Rainer Hochecker <fernetmenta@online.de>
Date: Mon, 22 Sep 2014 18:18:09 +0200
Subject: [PATCH] dvdplayer: adapt matroshka ssa subs to ffmpeg 2.4 api change
---
xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 1 +
xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.cpp | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
index f8a5635..f688f95 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
@@ -327,6 +327,7 @@ CDVDOverlayCodec* CDVDFactoryCodec::CreateOverlayCodec( CDVDStreamInfo &hint )
break;
case AV_CODEC_ID_SSA:
+ case AV_CODEC_ID_ASS:
pCodec = OpenCodec(new CDVDOverlayCodecSSA(), hint, options);
if( pCodec ) return pCodec;
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.cpp
index 03cda12..7cd6c2d 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.cpp
@@ -45,7 +45,8 @@ CDVDOverlayCodecSSA::~CDVDOverlayCodecSSA()
bool CDVDOverlayCodecSSA::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
{
- if(hints.codec != AV_CODEC_ID_SSA)
+ if(hints.codec != AV_CODEC_ID_SSA &&
+ hints.codec != AV_CODEC_ID_ASS)
return false;
Dispose();

View File

@ -0,0 +1,38 @@
From 33ecbf84af6cd890ffb6a2562e8d4b6ce65729e5 Mon Sep 17 00:00:00 2001
From: Rainer Hochecker <fernetmenta@online.de>
Date: Fri, 26 Sep 2014 07:50:56 +0200
Subject: [PATCH] dvdplayer: fix ass subs for AV_CODEC_ID_ASS after ffmpeg bump
to 2.4
---
xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.cpp | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.cpp
index 7cd6c2d..755eb6b 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.cpp
@@ -71,6 +71,8 @@ int CDVDOverlayCodecSSA::Decode(DemuxPacket *pPacket)
return OC_ERROR;
double pts = pPacket->dts != DVD_NOPTS_VALUE ? pPacket->dts : pPacket->pts;
+ if (pts == DVD_NOPTS_VALUE)
+ pts = 0;
uint8_t *data = pPacket->pData;
int size = pPacket->iSize;
double duration = pPacket->duration;
@@ -118,6 +120,14 @@ int CDVDOverlayCodecSSA::Decode(DemuxPacket *pPacket)
else
m_libass->DecodeDemuxPkt((char*)data, size, pts, duration);
+ if (m_pOverlay && m_pOverlay->iPTSStartTime == pts)
+ {
+ if (m_pOverlay->iPTSStopTime < pts + duration)
+ m_pOverlay->iPTSStopTime = pts + duration;
+ m_output = true;
+ return OC_OVERLAY;
+ }
+
if(m_pOverlay)
{
/* there will only ever be one active, so we