Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mfvideosrc: attempt to unlock ReadSample() in gst_mf_source_reader_un… #26

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,13 @@ gst_mf_source_reader_read_sample (GstMFSourceReader * self)
hr = self->reader->ReadSample (type->stream_index, 0, nullptr, &stream_flags,
nullptr, &sample);

if (hr == MF_E_NOTACCEPTING) {
/* unlock() called Flush() on the reader */
g_assert (!sample);
GST_DEBUG_OBJECT (self, "ReadSample returned MF_E_NOTACCEPTING, flushing");
return GST_FLOW_FLUSHING;
}

if (!gst_mf_result (hr)) {
GST_ERROR_OBJECT (self, "Failed to read sample");
return GST_FLOW_ERROR;
Expand Down Expand Up @@ -730,6 +737,13 @@ gst_mf_source_reader_unlock (GstMFSourceObject * object)
GstMFSourceReader *self = GST_MF_SOURCE_READER (object);

g_mutex_lock (&self->lock);

GstMFStreamMediaType *type = self->cur_type;
if (self->reader) {
HRESULT hr = self->reader->Flush (type->stream_index);
GST_LOG_OBJECT (self, "Flush() returned: %u", hr);
}

self->flushing = TRUE;
g_mutex_unlock (&self->lock);

Expand Down