From 482d8aacb4772f47b49c3b8b7372bd368edcc6fe Mon Sep 17 00:00:00 2001 From: jcdr428 Date: Thu, 10 Aug 2023 08:57:43 +0100 Subject: [PATCH] Fixes --- tsMuxer/ac3Codec.h | 18 +++++++++--------- tsMuxer/bitStream.h | 4 ++-- tsMuxer/matroskaDemuxer.cpp | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tsMuxer/ac3Codec.h b/tsMuxer/ac3Codec.h index 06c37f3b..4e8c967f 100644 --- a/tsMuxer/ac3Codec.h +++ b/tsMuxer/ac3Codec.h @@ -76,20 +76,20 @@ class AC3Codec bool m_waitMoreData; bool m_downconvertToAC3; bool m_true_hd_mode; - uint8_t m_fscod; + int m_fscod; int m_frmsizecod; uint8_t m_bsid; uint8_t m_bsidBase; - uint8_t m_strmtyp; - uint8_t m_bsmod; - uint8_t m_acmod; - uint8_t m_dsurmod; - uint8_t m_lfeon; + int m_strmtyp; + int m_bsmod; + int m_acmod; + int m_dsurmod; + int m_lfeon; uint8_t m_halfratecod; int m_sample_rate; - int32_t m_bit_rate; - uint8_t m_channels; - uint16_t m_frame_size; + int m_bit_rate; + int m_channels; + int m_frame_size; bool m_mixinfoexists; MLPCodec mlp; diff --git a/tsMuxer/bitStream.h b/tsMuxer/bitStream.h index 64b719f8..455fcb83 100644 --- a/tsMuxer/bitStream.h +++ b/tsMuxer/bitStream.h @@ -108,9 +108,9 @@ class BitStreamReader : public BitStream return prevVal + (m_curVal >> m_bitLeft); } - inline unsigned showBits(unsigned num) + inline int showBits(unsigned num) { - if (num > INT_BIT || m_totalBits < num) + if (num > INT_BIT - 1 || m_totalBits < num) THROW_BITSTREAM_ERR; unsigned prevVal = 0; unsigned bitLeft = m_bitLeft; diff --git a/tsMuxer/matroskaDemuxer.cpp b/tsMuxer/matroskaDemuxer.cpp index f62c5617..6e6d2ebc 100644 --- a/tsMuxer/matroskaDemuxer.cpp +++ b/tsMuxer/matroskaDemuxer.cpp @@ -1148,7 +1148,7 @@ int MatroskaDemuxer::readPacket(AVPacket &avPacket) memcpy(&avPacket, newPacket, sizeof(AVPacket)); } else - memset(&avPacket, 0, sizeof(avPacket)); + memset(&avPacket, 0, sizeof(AVPacket)); m_lastDeliveryPacket = newPacket; return 0; } @@ -1398,7 +1398,7 @@ int MatroskaDemuxer::matroska_parse_info() double num; if ((res = ebml_read_float(&id, &num)) < 0) break; - fileDuration = static_cast(num * time_scale); + fileDuration = static_cast(num * static_cast(time_scale)); break; } @@ -1407,7 +1407,7 @@ int MatroskaDemuxer::matroska_parse_info() char *text; if ((res = ebml_read_utf8(&id, &text)) < 0) break; - strncpy(m_title, text, sizeof(title) - 1); + strncpy(m_title, text, sizeof(m_title) - 1); delete[] text; break; }