History

GSF.Core: Updated MultiSourceFrameImageParserBase to skip parsing if the received buffer contains no data.

StephenCWills committed 13 years ago

Commit 22bbdb41 parent d88cbd91 file · +11 −8Browse files

Showing the changes to Source/Libraries/GSF.Core/Parsing/MultiSourceFrameImageParserBase.cs (1 of 1 file). Show all

Unified · Split

Source/Libraries/GSF.Core/Parsing/MultiSourceFrameImageParserBase.cs+11−8
@@ -378,16 +378,19 @@ namespace GSF.Parsing · 377 unmodified lines
378 378
379 try379 try
380 {380 {
381 // Get an identifiable buffer object381 if (count > 0)
382 identifiableBuffer = ReusableObjectPool<SourceIdentifiableBuffer>.Default.TakeObject();382 {
383 identifiableBuffer.Source = source;383 // Get an identifiable buffer object
384 identifiableBuffer.Count = count;384 identifiableBuffer = ReusableObjectPool<SourceIdentifiableBuffer>.Default.TakeObject();
385 identifiableBuffer.Source = source;
386 identifiableBuffer.Count = count;
385 387
386 // Copy buffer data for processing (destination buffer preallocated from buffer pool)388 // Copy buffer data for processing (destination buffer preallocated from buffer pool)
387 Buffer.BlockCopy(buffer, offset, identifiableBuffer.Buffer, 0, count);389 Buffer.BlockCopy(buffer, offset, identifiableBuffer.Buffer, 0, count);
388 390
389 // Add buffer to the queue for parsing391 // Add buffer to the queue for parsing
390 m_bufferQueue.Add(identifiableBuffer);392 m_bufferQueue.Add(identifiableBuffer);
393 }
391 }394 }
392 catch395 catch
393 {396 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t