A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Haivision/srt/commit/308cd309246745fca438b960fb6f6764f32fa1c4 below:

[core] Added missing lock to CSndBuffer::readData · Haivision/srt@308cd30 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+8

-0

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+8

-0

lines changed Original file line number Diff line number Diff line change

@@ -402,6 +402,7 @@ int CSndBuffer::readData(CPacket& w_packet, steady_clock::time_point& w_srctime,

402 402

int readlen = 0;

403 403

w_seqnoinc = 0;

404 404 405 +

ScopedLock bufferguard(m_BufLock);

405 406

while (m_pCurrBlock != m_pLastBlock)

406 407

{

407 408

// Make the packet REFLECT the data stored in the buffer.

Original file line number Diff line number Diff line change

@@ -133,12 +133,14 @@ class CSndBuffer

133 133

/// @param [in] data pointer to the user data block.

134 134

/// @param [in] len size of the block.

135 135

/// @param [inout] w_mctrl Message control data

136 +

SRT_ATTR_EXCLUDES(m_BufLock)

136 137

void addBuffer(const char* data, int len, SRT_MSGCTRL& w_mctrl);

137 138 138 139

/// Read a block of data from file and insert it into the sending list.

139 140

/// @param [in] ifs input file stream.

140 141

/// @param [in] len size of the block.

141 142

/// @return actual size of data added from the file.

143 +

SRT_ATTR_EXCLUDES(m_BufLock)

142 144

int addBufferFromFile(std::fstream& ifs, int len);

143 145 144 146

/// Find data position to pack a DATA packet from the furthest reading point.

@@ -147,6 +149,7 @@ class CSndBuffer

147 149

/// @param [in] kflags Odd|Even crypto key flag

148 150

/// @param [out] seqnoinc the number of packets skipped due to TTL, so that seqno should be incremented.

149 151

/// @return Actual length of data read.

152 +

SRT_ATTR_EXCLUDES(m_BufLock)

150 153

int readData(CPacket& w_packet, time_point& w_origintime, int kflgs, int& w_seqnoinc);

151 154 152 155

/// Find data position to pack a DATA packet for a retransmission.

@@ -155,12 +158,14 @@ class CSndBuffer

155 158

/// @param [out] origintime origin time stamp of the message

156 159

/// @param [out] msglen length of the message

157 160

/// @return Actual length of data read (return 0 if offset too large, -1 if TTL exceeded).

161 +

SRT_ATTR_EXCLUDES(m_BufLock)

158 162

int readData(const int offset, CPacket& w_packet, time_point& w_origintime, int& w_msglen);

159 163 160 164

/// Get the time of the last retransmission (if any) of the DATA packet.

161 165

/// @param [in] offset offset from the last ACK point (backward sequence number difference)

162 166

///

163 167

/// @return Last time of the last retransmission event for the corresponding DATA packet.

168 +

SRT_ATTR_EXCLUDES(m_BufLock)

164 169

time_point getPacketRexmitTime(const int offset);

165 170 166 171

/// Update the ACK point and may release/unmap/return the user data according to the flag.

@@ -173,6 +178,7 @@ class CSndBuffer

173 178

/// @return Current size of the data in the sending list.

174 179

int getCurrBufSize() const;

175 180 181 +

SRT_ATTR_EXCLUDES(m_BufLock)

176 182

int dropLateData(int& bytes, int32_t& w_first_msgno, const time_point& too_late_time);

177 183 178 184

void updAvgBufSize(const time_point& time);

@@ -181,6 +187,7 @@ class CSndBuffer

181 187 182 188

/// @brief Get the buffering delay of the oldest message in the buffer.

183 189

/// @return the delay value.

190 +

SRT_ATTR_EXCLUDES(m_BufLock)

184 191

duration getBufferingDelay(const time_point& tnow) const;

185 192 186 193

uint64_t getInRatePeriod() const { return m_InRatePeriod; }

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4