BugFix Buffer reset to be ready for reload

This commit is contained in:
Bruno Herbelin
2024-10-04 17:10:07 +02:00
parent e6b954e9e8
commit 2ec267fc4f
2 changed files with 6 additions and 2 deletions

View File

@@ -802,8 +802,10 @@ void MediaPlayer::close()
// cleanup eventual remaining frame memory
for(guint i = 0; i < N_VFRAME; i++) {
frame_[i].access.lock();
if (frame_[i].buffer)
if (frame_[i].buffer) {
gst_buffer_unref(frame_[i].buffer);
frame_[i].buffer = NULL;
}
frame_[i].status = INVALID;
frame_[i].access.unlock();
}

View File

@@ -424,8 +424,10 @@ void Stream::close()
// cleanup eventual remaining frame memory
for(guint i = 0; i < N_FRAME; ++i){
frame_[i].access.lock();
if (frame_[i].buffer)
if (frame_[i].buffer) {
gst_buffer_unref(frame_[i].buffer);
frame_[i].buffer = NULL;
}
frame_[i].status = INVALID;
frame_[i].access.unlock();
}