Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
d22d955d
Commit
d22d955d
authored
Mar 10, 2011
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dvb: refactor dvb-c scanning code out from scan_Next()
parent
2095481e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
44 deletions
+47
-44
modules/access/dvb/scan.c
modules/access/dvb/scan.c
+47
-44
No files found.
modules/access/dvb/scan.c
View file @
d22d955d
...
...
@@ -479,6 +479,52 @@ static int ScanDvbTNextFast( scan_t *p_scan, scan_configuration_t *p_cfg, double
static
int
ScanDvbCNext
(
scan_t
*
p_scan
,
scan_configuration_t
*
p_cfg
,
double
*
pf_pos
)
{
bool
b_servicefound
=
false
;
for
(
int
i
=
0
;
i
<
p_scan
->
i_service
;
i
++
)
{
b_servicefound
=
(
p_scan
->
pp_service
[
i
]
->
type
!=
SERVICE_UNKNOWN
);
if
(
b_servicefound
)
break
;
}
if
(
!
b_servicefound
)
{
bool
b_rotate
=
true
;
if
(
!
p_scan
->
parameter
.
b_modulation_set
)
{
p_scan
->
parameter
.
i_modulation
=
(
p_scan
->
parameter
.
i_modulation
<<
1
)
%
512
;
/* if we iterated all modulations, move on */
if
(
!
p_scan
->
parameter
.
i_modulation
)
{
p_scan
->
parameter
.
i_modulation
=
16
;
}
else
{
b_rotate
=
false
;
}
msg_Dbg
(
p_scan
->
p_obj
,
"modulation %d "
,
p_scan
->
parameter
.
i_modulation
);
}
if
(
!
p_scan
->
parameter
.
b_symbolrate_set
)
{
/* symbol rates from dvb-tools dvb-c files */
static
const
unsigned
short
symbolrates
[]
=
{
6900
,
6875
,
6950
,
7000
,
3450
,
6111
,
6428
,
6952
,
5900
,
5000
};
enum
{
num_symbols
=
(
sizeof
(
symbolrates
)
/
sizeof
(
*
symbolrates
))
};
/* if we rotated modulations, rotate symbolrate */
if
(
b_rotate
)
p_scan
->
parameter
.
i_symbolrate
=
(
++
p_scan
->
parameter
.
i_symbolrate
%
num_symbols
);
p_cfg
->
i_symbolrate
=
1000
*
(
symbolrates
[
p_scan
->
parameter
.
i_symbolrate
]
);
msg_Dbg
(
p_scan
->
p_obj
,
"symbolrate %d"
,
p_cfg
->
i_symbolrate
);
if
(
p_scan
->
parameter
.
i_symbolrate
)
b_rotate
=
false
;
}
if
(
!
b_rotate
&&
p_scan
->
i_index
)
p_scan
->
i_index
--
;
}
p_cfg
->
i_modulation
=
p_scan
->
parameter
.
i_modulation
;
if
(
!
p_cfg
->
i_symbolrate
)
p_cfg
->
i_symbolrate
=
var_GetInteger
(
p_scan
->
p_obj
,
"dvb-srate"
);
if
(
p_scan
->
parameter
.
b_exhaustive
)
return
ScanDvbNextExhaustive
(
p_scan
,
p_cfg
,
pf_pos
);
else
...
...
@@ -554,50 +600,7 @@ int scan_Next( scan_t *p_scan, scan_configuration_t *p_cfg )
free
(
psz_text
);
}
if
(
i_service
==
0
&&
p_scan
->
parameter
.
type
==
SCAN_DVB_C
)
{
bool
b_rotate
=
true
;
if
(
!
p_scan
->
parameter
.
b_modulation_set
)
{
p_scan
->
parameter
.
i_modulation
=
(
p_scan
->
parameter
.
i_modulation
<<
1
)
%
512
;
/* if we iterated all modulations, move on */
if
(
!
p_scan
->
parameter
.
i_modulation
)
{
p_scan
->
parameter
.
i_modulation
=
16
;
}
else
{
b_rotate
=
false
;
}
msg_Dbg
(
p_scan
->
p_obj
,
"modulation %d "
,
p_scan
->
parameter
.
i_modulation
);
}
if
(
!
p_scan
->
parameter
.
b_symbolrate_set
)
{
/* symbol rates from dvb-tools dvb-c files */
static
const
unsigned
short
symbolrates
[]
=
{
6900
,
6875
,
6950
,
7000
,
3450
,
6111
,
6428
,
6952
,
5900
,
5000
};
enum
{
num_symbols
=
(
sizeof
(
symbolrates
)
/
sizeof
(
*
symbolrates
))
};
/* if we rotated modulations, rotate symbolrate */
if
(
b_rotate
)
p_scan
->
parameter
.
i_symbolrate
=
(
++
p_scan
->
parameter
.
i_symbolrate
%
num_symbols
);
p_cfg
->
i_symbolrate
=
1000
*
(
symbolrates
[
p_scan
->
parameter
.
i_symbolrate
]
);
msg_Dbg
(
p_scan
->
p_obj
,
"symbolrate %d"
,
p_cfg
->
i_symbolrate
);
if
(
p_scan
->
parameter
.
i_symbolrate
)
b_rotate
=
false
;
}
if
(
b_rotate
)
p_scan
->
i_index
++
;
}
else
{
p_scan
->
i_index
++
;
}
if
(
p_scan
->
parameter
.
type
==
SCAN_DVB_C
)
{
p_cfg
->
i_modulation
=
p_scan
->
parameter
.
i_modulation
;
if
(
!
p_cfg
->
i_symbolrate
)
p_cfg
->
i_symbolrate
=
var_GetInteger
(
p_scan
->
p_obj
,
"dvb-srate"
);
}
p_scan
->
i_index
++
;
return
VLC_SUCCESS
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment