Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
obs-studio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yunxiang Li
obs-studio
Commits
1cf19d06
Commit
1cf19d06
authored
10 years ago
by
fryshorts
Browse files
Options
Downloads
Patches
Plain Diff
Fix infinite loop in v4l2 plugin
With no device present the capability callbacks would cause an infinite loop.
parent
3394ac64
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/linux-v4l2/v4l2-input.c
+9
-0
9 additions, 0 deletions
plugins/linux-v4l2/v4l2-input.c
with
9 additions
and
0 deletions
plugins/linux-v4l2/v4l2-input.c
+
9
−
0
View file @
1cf19d06
...
@@ -408,6 +408,9 @@ static bool device_selected(obs_properties_t props, obs_property_t p,
...
@@ -408,6 +408,9 @@ static bool device_selected(obs_properties_t props, obs_property_t p,
UNUSED_PARAMETER
(
p
);
UNUSED_PARAMETER
(
p
);
int
dev
=
open
(
obs_data_getstring
(
settings
,
"device_id"
),
int
dev
=
open
(
obs_data_getstring
(
settings
,
"device_id"
),
O_RDWR
|
O_NONBLOCK
);
O_RDWR
|
O_NONBLOCK
);
if
(
dev
==
-
1
)
return
false
;
obs_property_t
prop
=
obs_properties_get
(
props
,
"pixelformat"
);
obs_property_t
prop
=
obs_properties_get
(
props
,
"pixelformat"
);
v4l2_format_list
(
dev
,
prop
);
v4l2_format_list
(
dev
,
prop
);
obs_property_modified
(
prop
,
settings
);
obs_property_modified
(
prop
,
settings
);
...
@@ -424,6 +427,9 @@ static bool format_selected(obs_properties_t props, obs_property_t p,
...
@@ -424,6 +427,9 @@ static bool format_selected(obs_properties_t props, obs_property_t p,
UNUSED_PARAMETER
(
p
);
UNUSED_PARAMETER
(
p
);
int
dev
=
open
(
obs_data_getstring
(
settings
,
"device_id"
),
int
dev
=
open
(
obs_data_getstring
(
settings
,
"device_id"
),
O_RDWR
|
O_NONBLOCK
);
O_RDWR
|
O_NONBLOCK
);
if
(
dev
==
-
1
)
return
false
;
obs_property_t
prop
=
obs_properties_get
(
props
,
"resolution"
);
obs_property_t
prop
=
obs_properties_get
(
props
,
"resolution"
);
v4l2_resolution_list
(
dev
,
obs_data_getint
(
settings
,
"pixelformat"
),
v4l2_resolution_list
(
dev
,
obs_data_getint
(
settings
,
"pixelformat"
),
prop
);
prop
);
...
@@ -442,6 +448,9 @@ static bool resolution_selected(obs_properties_t props, obs_property_t p,
...
@@ -442,6 +448,9 @@ static bool resolution_selected(obs_properties_t props, obs_property_t p,
int
width
,
height
;
int
width
,
height
;
int
dev
=
open
(
obs_data_getstring
(
settings
,
"device_id"
),
int
dev
=
open
(
obs_data_getstring
(
settings
,
"device_id"
),
O_RDWR
|
O_NONBLOCK
);
O_RDWR
|
O_NONBLOCK
);
if
(
dev
==
-
1
)
return
false
;
obs_property_t
prop
=
obs_properties_get
(
props
,
"framerate"
);
obs_property_t
prop
=
obs_properties_get
(
props
,
"framerate"
);
unpack_tuple
(
&
width
,
&
height
,
obs_data_getint
(
settings
,
unpack_tuple
(
&
width
,
&
height
,
obs_data_getint
(
settings
,
"resolution"
));
"resolution"
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment