Skip to content

Fix gst_initializer#20796

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
JonasVautherin:patch-1
Oct 2, 2021
Merged

Fix gst_initializer#20796
opencv-pushbot merged 1 commit intoopencv:3.4from
JonasVautherin:patch-1

Conversation

@JonasVautherin
Copy link
Copy Markdown
Contributor

@JonasVautherin JonasVautherin commented Oct 2, 2021

I noticed this while reading the code, and it seems wrong to me. From the documentation, gst_init_check "will return FALSE if GStreamer could not be initialized for some reason".

I do not understand why the current code ever works, because in my test project (with gstreamer 1.16.2), err is never NULL after a call to gst_init_check(NULL, NULL, &err);. But I could imagine that it is different with other versions of gstreamer.

I haven't tested my patch at all, but it seemed important enough to open a discussion, and a PR seemed like a good way. Feel free to close if I am missing something 😇.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake
build_image:Custom=gstreamer:14.04
buildworker:Custom=linux-4

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contribution!

Use the return value of gst_init_check instead of testing the error pointer
@JonasVautherin
Copy link
Copy Markdown
Contributor Author

@alalek: thanks for the fix, and sorry for the compilation error 😕. As I said I don't even use/compile OpenCV, I just wanted to report this bug I found by chance 😅

@opencv-pushbot opencv-pushbot merged commit 7358fff into opencv:3.4 Oct 2, 2021
@alalek alalek mentioned this pull request Oct 2, 2021
@JonasVautherin JonasVautherin deleted the patch-1 branch October 2, 2021 18:36
@JonasVautherin JonasVautherin mentioned this pull request Oct 3, 2021
6 tasks
@alalek alalek mentioned this pull request Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants