[Confluence] align subtitle popup to the bottom
[vuplus_xbmc] / xbmc / cores / dvdplayer / DVDCodecs / Video / StageFrightVideo.cpp
index 4ca0a27..4060f3b 100644 (file)
@@ -541,19 +541,6 @@ bool CStageFrightVideo::Open(CDVDStreamInfo &hints)
       CLog::Log(LOGERROR, "%s::%s - %s\n", CLASSNAME, __func__,"Blacklisted component (MP4)");
       goto fail;
     }
-    else if (!strncmp(component, "OMX.rk.", 7))
-    {
-      if (g_advancedSettings.m_stagefrightConfig.useAVCcodec != 1 && g_advancedSettings.m_stagefrightConfig.useMP4codec != 1) 
-      {
-        if (p->width % 32 != 0 || p->height % 16 != 0)
-        {
-          // Buggy. Hard crash on non MOD16 height videos and stride errors for non MOD32 width
-          CLog::Log(LOGERROR, "%s::%s - %s\n", CLASSNAME, __func__,"Blacklisted component (MOD16)");
-          goto fail;
-
-        }
-      }
-    }
   }
 
   cropLeft = cropTop = cropRight = cropBottom = 0;
@@ -616,6 +603,7 @@ int  CStageFrightVideo::Decode(uint8_t *pData, int iSize, double dts, double pts
   Frame *frame;
   int demuxer_bytes = iSize;
   uint8_t *demuxer_content = pData;
+  int ret = 0;
 
   if (demuxer_content)
   {
@@ -628,12 +616,21 @@ int  CStageFrightVideo::Decode(uint8_t *pData, int iSize, double dts, double pts
       frame->pts = (dts != DVD_NOPTS_VALUE) ? pts_dtoi(dts) : ((pts != DVD_NOPTS_VALUE) ? pts_dtoi(pts) : 0);
     else
       frame->pts = (pts != DVD_NOPTS_VALUE) ? pts_dtoi(pts) : ((dts != DVD_NOPTS_VALUE) ? pts_dtoi(dts) : 0);
+
+    // No valid pts? libstagefright asserts on this.
+    if (frame->pts < 0)
+    {
+      free(frame);
+      return ret;
+    }
+
     frame->medbuf = p->getBuffer(demuxer_bytes);
     if (!frame->medbuf)
     {
       free(frame);
       return VC_ERROR;
     }
+
     fast_memcpy(frame->medbuf->data(), demuxer_content, demuxer_bytes);
     frame->medbuf->meta_data()->clear();
     frame->medbuf->meta_data()->setInt64(kKeyTime, frame->pts);
@@ -645,7 +642,6 @@ int  CStageFrightVideo::Decode(uint8_t *pData, int iSize, double dts, double pts
     p->in_mutex.unlock();
   }
 
-  int ret = 0;
   if (p->inputBufferAvailable() && p->in_queue.size() < INBUFCOUNT)
     ret |= VC_BUFFER;
   else