Commit 8a289d37b03352dcc8062dbc5b3fdad66e8693eb
1 parent
193d0298
Reset returned FrameData in returnFrame, this is the safest way to do it
Showing
1 changed file
with
3 additions
and
3 deletions
openbr/plugins/stream.cpp
| @@ -226,9 +226,6 @@ public: | @@ -226,9 +226,6 @@ public: | ||
| 226 | if (aFrame == NULL) | 226 | if (aFrame == NULL) |
| 227 | return NULL; | 227 | return NULL; |
| 228 | 228 | ||
| 229 | - aFrame->data.clear(); | ||
| 230 | - aFrame->sequenceNumber = -1; | ||
| 231 | - | ||
| 232 | // Try to actually read a frame, if this returns false the data source is broken | 229 | // Try to actually read a frame, if this returns false the data source is broken |
| 233 | bool res = getNext(*aFrame); | 230 | bool res = getNext(*aFrame); |
| 234 | 231 | ||
| @@ -262,6 +259,8 @@ public: | @@ -262,6 +259,8 @@ public: | ||
| 262 | { | 259 | { |
| 263 | int frameNumber = inputFrame->sequenceNumber; | 260 | int frameNumber = inputFrame->sequenceNumber; |
| 264 | 261 | ||
| 262 | + inputFrame->data.clear(); | ||
| 263 | + inputFrame->sequenceNumber = -1; | ||
| 265 | allFrames.addItem(inputFrame); | 264 | allFrames.addItem(inputFrame); |
| 266 | 265 | ||
| 267 | bool rval = false; | 266 | bool rval = false; |
| @@ -1061,6 +1060,7 @@ public: | @@ -1061,6 +1060,7 @@ public: | ||
| 1061 | FrameData * firstFrame = readStage->dataSource.tryGetFrame(last_frame); | 1060 | FrameData * firstFrame = readStage->dataSource.tryGetFrame(last_frame); |
| 1062 | if (firstFrame == NULL) | 1061 | if (firstFrame == NULL) |
| 1063 | qFatal("Failed to read first frame of video"); | 1062 | qFatal("Failed to read first frame of video"); |
| 1063 | + | ||
| 1064 | readStage->startThread(firstFrame); | 1064 | readStage->startThread(firstFrame); |
| 1065 | lock.unlock(); | 1065 | lock.unlock(); |
| 1066 | 1066 |