Merge master branch, to bring in all changes

master
Dan Bryant 2019-11-25 08:52:00 +00:00
commit d379bed50a
5 changed files with 11 additions and 15 deletions

View File

@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 3.1)
project (tsmuxer_main)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS FALSE)

View File

@ -48,7 +48,7 @@ uint8_t* AACCodec::findAacFrame(uint8_t* buffer, uint8_t* end)
int AACCodec::getFrameSize(uint8_t* buffer)
{
return buffer[4]*8 + (buffer[5] >> 5);
return ((buffer[3] & 0x03) << 11) + (buffer[4] << 3) + (buffer[5] >> 5);
}
bool AACCodec::decodeFrame(uint8_t* buffer, uint8_t* end)

View File

@ -183,6 +183,7 @@ public:
if (frameSize == 0)
frameSize = m_sc->m_index[m_sc->m_indexCur++];
if (isAAC) {
m_aacRaw.m_channels = m_sc->channels;
m_aacRaw.buildADTSHeader(dst, frameSize + AAC_HEADER_LEN);
memcpy(dst + AAC_HEADER_LEN, buff, frameSize);
dst += frameSize + AAC_HEADER_LEN;
@ -1451,6 +1452,7 @@ int MovDemuxer::mov_read_esds(MOVAtom atom)
if (st->parsed_priv_data) {
((MovParsedAudioTrackData*)st->parsed_priv_data)->isAAC = true;
st->parsed_priv_data->setPrivData(st->codec_priv, st->codec_priv_size);
st->channels = (st->codec_priv[1] >> 3) & 0x0f;
}
}
}

View File

@ -62,12 +62,8 @@ int MPEGStreamReader::flushPacket(AVPacket& avPacket)
}
if (decodeRez == 0) {
avPacket.data = m_tmpBuffer;
avPacket.size = std::min(MAX_AV_PACKET_SIZE, m_tmpBufferLen);
avPacket.size = m_tmpBufferLen;
}
if (m_tmpBufferLen > MAX_AV_PACKET_SIZE) {
LTRACE(LT_ERROR, 2, "Too large last buffer (" << m_tmpBufferLen << " bytes). Truncate buffer to " <<
MAX_AV_PACKET_SIZE << " bytes. It does not have to be!");
}
}
avPacket.pts = m_curPts + m_timeOffset;
@ -127,12 +123,10 @@ int MPEGStreamReader::readPacket(AVPacket& avPacket)
return NEED_MORE_DATA;
}
if (m_bufEnd - m_curPos < MAX_AV_PACKET_SIZE) {
uint8_t* nextNal = NALUnit::findNALWithStartCode(std::min(m_curPos + 3,m_bufEnd), m_bufEnd, m_longCodesAllowed);
if (nextNal == m_bufEnd) {
storeBufferRest();
return NEED_MORE_DATA;
}
uint8_t* nextNal = NALUnit::findNALWithStartCode(std::min(m_curPos + 3,m_bufEnd), m_bufEnd, m_longCodesAllowed);
if (nextNal == m_bufEnd) {
storeBufferRest();
return NEED_MORE_DATA;
}
int isNal = bufFromNAL();

View File

@ -38,8 +38,8 @@ static const uint8_t STREAM_TYPE_PRIVATE_SECTION = 0x05;
static const uint8_t STREAM_TYPE_PRIVATE_DATA = 0x06;
static const uint8_t STREAM_TYPE_VIDEO_MPEG4 = 0x10;
static const uint8_t STREAM_TYPE_VIDEO_H264 = 0x1b;
//static const uint8_t STREAM_TYPE_VIDEO_H265 = 0x24;
static const uint8_t STREAM_TYPE_VIDEO_H265 = 0x06;
static const uint8_t STREAM_TYPE_VIDEO_H265 = 0x24;
//static const uint8_t STREAM_TYPE_VIDEO_H265 = 0x06;
static const uint8_t STREAM_TYPE_VIDEO_MVC = 0x20;
static const uint8_t STREAM_TYPE_VIDEO_VC1 = 0xea;