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 | 226 | if (aFrame == NULL) |
| 227 | 227 | return NULL; |
| 228 | 228 | |
| 229 | - aFrame->data.clear(); | |
| 230 | - aFrame->sequenceNumber = -1; | |
| 231 | - | |
| 232 | 229 | // Try to actually read a frame, if this returns false the data source is broken |
| 233 | 230 | bool res = getNext(*aFrame); |
| 234 | 231 | |
| ... | ... | @@ -262,6 +259,8 @@ public: |
| 262 | 259 | { |
| 263 | 260 | int frameNumber = inputFrame->sequenceNumber; |
| 264 | 261 | |
| 262 | + inputFrame->data.clear(); | |
| 263 | + inputFrame->sequenceNumber = -1; | |
| 265 | 264 | allFrames.addItem(inputFrame); |
| 266 | 265 | |
| 267 | 266 | bool rval = false; |
| ... | ... | @@ -1061,6 +1060,7 @@ public: |
| 1061 | 1060 | FrameData * firstFrame = readStage->dataSource.tryGetFrame(last_frame); |
| 1062 | 1061 | if (firstFrame == NULL) |
| 1063 | 1062 | qFatal("Failed to read first frame of video"); |
| 1063 | + | |
| 1064 | 1064 | readStage->startThread(firstFrame); |
| 1065 | 1065 | lock.unlock(); |
| 1066 | 1066 | ... | ... |