Skip to content

Commit

Permalink
Enought to Enough (#91)
Browse files Browse the repository at this point in the history
Explicit enought ;)
  • Loading branch information
jcdr428 authored and lighterowl committed Dec 27, 2019
1 parent cadb85a commit b03ecf1
Show file tree
Hide file tree
Showing 20 changed files with 128 additions and 128 deletions.
2 changes: 1 addition & 1 deletion tsMuxer/aac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ bool AACCodec::decodeFrame(uint8_t* buffer, uint8_t* end)
m_bit_rate = frameSize * 8 * m_sample_rate / m_samples;
return true;
} catch(BitStreamException) {
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
}
}

Expand Down
12 changes: 6 additions & 6 deletions tsMuxer/ac3Codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ int AC3Codec::decodeFrame(uint8_t *buf, uint8_t *end, int& skipBytes)
int err;

if (end - buf < 2)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
if (m_state != stateDecodeAC3 && buf[0] == 0x0B && buf[1] == 0x77) {
if (testDecodeTestFrame(buf, end))
m_state = stateDecodeAC3;
Expand All @@ -352,11 +352,11 @@ int AC3Codec::decodeFrame(uint8_t *buf, uint8_t *end, int& skipBytes)
{
uint8_t* trueHDData = buf + rez;
if (end - trueHDData < 8)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
if (!isSyncWorld(trueHDData) && isHDSyncWorld(trueHDData+4))
{
if (end - trueHDData < 21)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
m_true_hd_mode = decodeDtsHdFrame(trueHDData, trueHDData + 21);
}
}
Expand All @@ -365,7 +365,7 @@ int AC3Codec::decodeFrame(uint8_t *buf, uint8_t *end, int& skipBytes)
{
uint8_t* trueHDData = buf + rez;
if (end - trueHDData < 7)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
if (m_state == stateDecodeAC3)
{
// check if it is a real HD frame
Expand All @@ -383,7 +383,7 @@ int AC3Codec::decodeFrame(uint8_t *buf, uint8_t *end, int& skipBytes)
trueHDFrameLen += trueHDData[1];
trueHDFrameLen *= 2;
if (end - trueHDData < trueHDFrameLen+7)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
if (!m_true_hd_mode)
{
//m_true_hd_mode |= findMajorSync(trueHDData, trueHDData + trueHDFrameLen);
Expand Down Expand Up @@ -412,7 +412,7 @@ int AC3Codec::decodeFrame(uint8_t *buf, uint8_t *end, int& skipBytes)
return rez;
}
} catch(BitStreamException&) {
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
}
}

Expand Down
6 changes: 3 additions & 3 deletions tsMuxer/combinedH264Demuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ CombinedH264Reader::ReadState CombinedH264Reader::detectStreamByNal(const uint8_
else if (nalType == nuSubSPS) {
SPSUnit sps;
sps.decodeBuffer(data, dataEnd);
if (sps.deserialize() == NOT_ENOUGHT_BUFFER)
if (sps.deserialize() == NOT_ENOUGH_BUFFER)
return ReadState_NeedMoreData;
m_mvcSPS = sps.seq_parameter_set_id;
return ReadState_Secondary;
Expand All @@ -77,7 +77,7 @@ CombinedH264Reader::ReadState CombinedH264Reader::detectStreamByNal(const uint8_
{
PPSUnit pps;
pps.decodeBuffer(data, dataEnd);
if (pps.deserialize() == NOT_ENOUGHT_BUFFER)
if (pps.deserialize() == NOT_ENOUGH_BUFFER)
return ReadState_NeedMoreData;
if (pps.seq_parameter_set_id == m_mvcSPS)
return ReadState_Secondary;
Expand All @@ -88,7 +88,7 @@ CombinedH264Reader::ReadState CombinedH264Reader::detectStreamByNal(const uint8_
SEIUnit sei;
sei.decodeBuffer(data, dataEnd);
int rez = sei.isMVCSEI();
if (rez == NOT_ENOUGHT_BUFFER)
if (rez == NOT_ENOUGH_BUFFER)
return ReadState_NeedMoreData;
else if (rez == 0)
return ReadState_Primary;
Expand Down
12 changes: 6 additions & 6 deletions tsMuxer/dtsStreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ int DTSStreamReader::decodeHdInfo(uint8_t* buff, uint8_t* end)
if (m_hdType == DTS_SUBTYPE_UNINITIALIZED)
{
if (buff + headerSize + 4 > end)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
uint32_t* hdAudioData = (uint32_t*) (buff + headerSize);
switch(my_ntohl(*hdAudioData))
{
Expand Down Expand Up @@ -454,7 +454,7 @@ int DTSStreamReader::decodeHdInfo(uint8_t* buff, uint8_t* end)
}
return hdFrameSize;
} catch(BitStreamException& e) {
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
}
}

Expand Down Expand Up @@ -629,7 +629,7 @@ int DTSStreamReader::decodeFrame(uint8_t* buff, uint8_t* end, int& skipBytes, in
}
afterFrameData = buff + i_frame_size;
if (afterFrameData > end - 4)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;

if (m_testMode && m_dtsEsChannels == 0)
{
Expand All @@ -653,12 +653,12 @@ int DTSStreamReader::decodeFrame(uint8_t* buff, uint8_t* end, int& skipBytes, in
m_dts_hd_mode = true;

int hdFrameSize = decodeHdInfo(afterFrameData, end);
if (hdFrameSize == NOT_ENOUGHT_BUFFER)
return NOT_ENOUGHT_BUFFER;
if (hdFrameSize == NOT_ENOUGH_BUFFER)
return NOT_ENOUGH_BUFFER;

uint8_t* nextFrame = afterFrameData + hdFrameSize;
if (nextFrame >= end)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
if (m_downconvertToDTS) {
skipBytes = nextFrame - buff - i_frame_size;
return i_frame_size;
Expand Down
18 changes: 9 additions & 9 deletions tsMuxer/dvbSubStreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int DVBSubStreamReader::intDecodeFrame(uint8_t* buff, uint8_t* end)
int buf_size = end - buff;

if (buf_size < 10)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
m_start_display_time = 0;
m_end_display_time = 0;

Expand Down Expand Up @@ -104,7 +104,7 @@ int DVBSubStreamReader::intDecodeFrame(uint8_t* buff, uint8_t* end)
case 0x03:
// set colormap
if ((buf_size - pos) < 2)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
colormap[3] = buff[pos] >> 4;
colormap[2] = buff[pos] & 0x0f;
colormap[1] = buff[pos + 1] >> 4;
Expand All @@ -114,7 +114,7 @@ int DVBSubStreamReader::intDecodeFrame(uint8_t* buff, uint8_t* end)
case 0x04:
// set alpha
if ((buf_size - pos) < 2)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
alpha[3] = buff[pos] >> 4;
alpha[2] = buff[pos] & 0x0f;
alpha[1] = buff[pos + 1] >> 4;
Expand All @@ -124,7 +124,7 @@ int DVBSubStreamReader::intDecodeFrame(uint8_t* buff, uint8_t* end)
case 0x05:
case 0x85:
if ((buf_size - pos) < 6)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
x1 = (buff[pos] << 4) | (buff[pos + 1] >> 4);
x2 = ((buff[pos + 1] & 0x0f) << 8) | buff[pos + 2];
y1 = (buff[pos + 3] << 4) | (buff[pos + 4] >> 4);
Expand All @@ -135,14 +135,14 @@ int DVBSubStreamReader::intDecodeFrame(uint8_t* buff, uint8_t* end)
break;
case 0x06:
if ((buf_size - pos) < 4)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
offset1 = AV_RB16(buff + pos);
offset2 = AV_RB16(buff + pos + 2);
pos += 4;
break;
case 0x86:
if ((buf_size - pos) < 8)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
offset1 = AV_RB32(buff + pos);
offset2 = AV_RB32(buff + pos + 4);
pos += 8;
Expand All @@ -151,14 +151,14 @@ int DVBSubStreamReader::intDecodeFrame(uint8_t* buff, uint8_t* end)
case 0x83:
// HD set palette
if ((buf_size - pos) < 768)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
yuv_palette = buff + pos;
pos += 768;
break;
case 0x84:
// HD set contrast (alpha)
if ((buf_size - pos) < 256)
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
for (i = 0; i < 256; i++)
alpha[i] = 0xFF - buff[pos+i];
pos += 256;
Expand All @@ -173,7 +173,7 @@ int DVBSubStreamReader::intDecodeFrame(uint8_t* buff, uint8_t* end)
}
}
}
return NOT_ENOUGHT_BUFFER;
return NOT_ENOUGH_BUFFER;
}

double DVBSubStreamReader::getFrameDurationNano() {
Expand Down
Loading

0 comments on commit b03ecf1

Please sign in to comment.