Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
115ee65f
Commit
115ee65f
authored
Mar 17, 2011
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dvb: helper functions to decode BCD and get service_type
parent
5db70dc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
9 deletions
+27
-9
modules/access/dvb/scan.c
modules/access/dvb/scan.c
+27
-9
No files found.
modules/access/dvb/scan.c
View file @
115ee65f
...
@@ -145,6 +145,32 @@ static void scan_service_Delete( scan_service_t *p_srv )
...
@@ -145,6 +145,32 @@ static void scan_service_Delete( scan_service_t *p_srv )
free
(
p_srv
);
free
(
p_srv
);
}
}
static
int
decode_BCD
(
uint32_t
input
,
uint32_t
*
output
)
{
char
*
psz_decoded
=
""
;
do
{
if
(
asprintf
(
&
psz_decoded
,
"%1d%1d%s"
,
(
input
&
0xf0
)
>>
4
,
input
&
0x0f
,
psz_decoded
?
psz_decoded
:
""
)
<
0
)
return
VLC_ENOMEM
;
input
>>=
8
;
}
while
(
input
);
*
output
=
atol
(
psz_decoded
);
free
(
psz_decoded
);
return
VLC_SUCCESS
;
}
static
int
scan_service_type
(
int
service_type
)
{
switch
(
service_type
)
{
case
0x01
:
return
SERVICE_DIGITAL_TELEVISION
;
break
;
case
0x02
:
return
SERVICE_DIGITAL_RADIO
;
break
;
case
0x16
:
return
SERVICE_DIGITAL_TELEVISION_AC_SD
;
break
;
case
0x19
:
return
SERVICE_DIGITAL_TELEVISION_AC_HD
;
break
;
default:
return
SERVICE_UNKNOWN
;
break
;
}
}
/* */
/* */
scan_t
*
scan_New
(
vlc_object_t
*
p_obj
,
const
scan_parameter_t
*
p_parameter
)
scan_t
*
scan_New
(
vlc_object_t
*
p_obj
,
const
scan_parameter_t
*
p_parameter
)
{
{
...
@@ -903,15 +929,7 @@ void scan_session_Destroy( scan_t *p_scan, scan_session_t *p_session )
...
@@ -903,15 +929,7 @@ void scan_session_Destroy( scan_t *p_scan, scan_session_t *p_session )
pD
->
i_service_name_length
);
pD
->
i_service_name_length
);
if
(
s
->
type
==
SERVICE_UNKNOWN
)
if
(
s
->
type
==
SERVICE_UNKNOWN
)
{
s
->
type
=
scan_service_type
(
pD
->
i_service_type
);
switch
(
pD
->
i_service_type
)
{
case
0x01
:
s
->
type
=
SERVICE_DIGITAL_TELEVISION
;
break
;
case
0x02
:
s
->
type
=
SERVICE_DIGITAL_RADIO
;
break
;
case
0x16
:
s
->
type
=
SERVICE_DIGITAL_TELEVISION_AC_SD
;
break
;
case
0x19
:
s
->
type
=
SERVICE_DIGITAL_TELEVISION_AC_HD
;
break
;
}
}
}
}
}
}
}
}
...
...
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