From 9d11b08ad61b1f0d6d7023ce403285d8662efaed Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 4 Mar 2015 00:23:39 +0100 Subject: sync with upstream --- xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp | 89 ---------------------- 1 file changed, 89 deletions(-) delete mode 100644 xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp (limited to 'xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp') diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp deleted file mode 100644 index ab298b2..0000000 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2005-2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * . - * - */ - -#if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS) - #include "config.h" -#endif -#include "DVDDemuxUtils.h" -#include "DVDClock.h" -#include "utils/log.h" - -extern "C" { -#include "libavcodec/avcodec.h" -} - -void CDVDDemuxUtils::FreeDemuxPacket(DemuxPacket* pPacket) -{ - if (pPacket) - { - try { - if (pPacket->pData) _aligned_free(pPacket->pData); - delete pPacket; - } - catch(...) { - CLog::Log(LOGERROR, "%s - Exception thrown while freeing packet", __FUNCTION__); - } - } -} - -DemuxPacket* CDVDDemuxUtils::AllocateDemuxPacket(int iDataSize) -{ - DemuxPacket* pPacket = new DemuxPacket; - if (!pPacket) return NULL; - - try - { - memset(pPacket, 0, sizeof(DemuxPacket)); - - if (iDataSize > 0) - { - // need to allocate a few bytes more. - // From avcodec.h (ffmpeg) - /** - * Required number of additionally allocated bytes at the end of the input bitstream for decoding. - * this is mainly needed because some optimized bitstream readers read - * 32 or 64 bit at once and could read over the end
- * Note, if the first 23 bits of the additional bytes are not 0 then damaged - * MPEG bitstreams could cause overread and segfault - */ - pPacket->pData =(uint8_t*)_aligned_malloc(iDataSize + FF_INPUT_BUFFER_PADDING_SIZE, 16); - if (!pPacket->pData) - { - FreeDemuxPacket(pPacket); - return NULL; - } - - // reset the last 8 bytes to 0; - memset(pPacket->pData + iDataSize, 0, FF_INPUT_BUFFER_PADDING_SIZE); - } - - // setup defaults - pPacket->dts = DVD_NOPTS_VALUE; - pPacket->pts = DVD_NOPTS_VALUE; - pPacket->iStreamId = -1; - } - catch(...) - { - CLog::Log(LOGERROR, "%s - Exception thrown", __FUNCTION__); - FreeDemuxPacket(pPacket); - pPacket = NULL; - } - return pPacket; -} -- cgit v1.2.3