Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libdvbpsi
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
libdvbpsi
Commits
3f0c670d
Commit
3f0c670d
authored
Dec 09, 2015
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder chain: rename dvbpsi_decoder_chain_new/delete to dvbpsi_chain_demux_new/delete
parent
66db4ffa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
45 deletions
+49
-45
examples/decode_bat.c
examples/decode_bat.c
+2
-2
examples/decode_pat.c
examples/decode_pat.c
+2
-2
examples/decode_sdt.c
examples/decode_sdt.c
+2
-2
examples/dvbinfo/libdvbpsi.c
examples/dvbinfo/libdvbpsi.c
+24
-24
src/chain.c
src/chain.c
+11
-7
src/chain.h
src/chain.h
+8
-8
No files found.
examples/decode_bat.c
View file @
3f0c670d
...
@@ -253,7 +253,7 @@ int main(int i_argc, char* pa_argv[])
...
@@ -253,7 +253,7 @@ int main(int i_argc, char* pa_argv[])
p_dvbpsi
=
dvbpsi_new
(
&
message
,
DVBPSI_MSG_DEBUG
);
p_dvbpsi
=
dvbpsi_new
(
&
message
,
DVBPSI_MSG_DEBUG
);
if
(
p_dvbpsi
==
NULL
)
if
(
p_dvbpsi
==
NULL
)
goto
out
;
goto
out
;
if
(
!
dvbpsi_
decoder_chain
_new
(
p_dvbpsi
,
NewSubtableBAT
,
DelSubtableBAT
,
NULL
))
if
(
!
dvbpsi_
chain_demux
_new
(
p_dvbpsi
,
NewSubtableBAT
,
DelSubtableBAT
,
NULL
))
goto
out
;
goto
out
;
b_ok
=
ReadPacket
(
i_fd
,
data
);
b_ok
=
ReadPacket
(
i_fd
,
data
);
...
@@ -271,7 +271,7 @@ int main(int i_argc, char* pa_argv[])
...
@@ -271,7 +271,7 @@ int main(int i_argc, char* pa_argv[])
out:
out:
if
(
p_dvbpsi
)
if
(
p_dvbpsi
)
{
{
if
(
!
dvbpsi_
decoder_chain
_delete
(
p_dvbpsi
))
if
(
!
dvbpsi_
chain_demux
_delete
(
p_dvbpsi
))
ret
=
1
;
ret
=
1
;
dvbpsi_delete
(
p_dvbpsi
);
dvbpsi_delete
(
p_dvbpsi
);
}
}
...
...
examples/decode_pat.c
View file @
3f0c670d
...
@@ -148,7 +148,7 @@ int main(int i_argc, char* pa_argv[])
...
@@ -148,7 +148,7 @@ int main(int i_argc, char* pa_argv[])
if
(
p_dvbpsi
==
NULL
)
if
(
p_dvbpsi
==
NULL
)
goto
out
;
goto
out
;
if
(
!
dvbpsi_
decoder_chain
_new
(
p_dvbpsi
,
AttachPAT
,
DetachPAT
,
NULL
))
if
(
!
dvbpsi_
chain_demux
_new
(
p_dvbpsi
,
AttachPAT
,
DetachPAT
,
NULL
))
goto
out
;
goto
out
;
b_ok
=
ReadPacket
(
i_fd
,
data
);
b_ok
=
ReadPacket
(
i_fd
,
data
);
...
@@ -165,7 +165,7 @@ int main(int i_argc, char* pa_argv[])
...
@@ -165,7 +165,7 @@ int main(int i_argc, char* pa_argv[])
out:
out:
if
(
p_dvbpsi
)
if
(
p_dvbpsi
)
{
{
if
(
!
dvbpsi_
decoder_chain
_delete
(
p_dvbpsi
))
if
(
!
dvbpsi_
chain_demux
_delete
(
p_dvbpsi
))
ret
=
1
;
ret
=
1
;
dvbpsi_delete
(
p_dvbpsi
);
dvbpsi_delete
(
p_dvbpsi
);
}
}
...
...
examples/decode_sdt.c
View file @
3f0c670d
...
@@ -184,7 +184,7 @@ int main(int i_argc, char* pa_argv[])
...
@@ -184,7 +184,7 @@ int main(int i_argc, char* pa_argv[])
if
(
p_dvbpsi
==
NULL
)
if
(
p_dvbpsi
==
NULL
)
goto
out
;
goto
out
;
if
(
!
dvbpsi_
decoder_chain
_new
(
p_dvbpsi
,
NewSubtable
,
DelSubtable
,
NULL
))
if
(
!
dvbpsi_
chain_demux
_new
(
p_dvbpsi
,
NewSubtable
,
DelSubtable
,
NULL
))
goto
out
;
goto
out
;
b_ok
=
ReadPacket
(
i_fd
,
data
);
b_ok
=
ReadPacket
(
i_fd
,
data
);
...
@@ -202,7 +202,7 @@ int main(int i_argc, char* pa_argv[])
...
@@ -202,7 +202,7 @@ int main(int i_argc, char* pa_argv[])
out:
out:
if
(
p_dvbpsi
)
if
(
p_dvbpsi
)
{
{
if
(
!
dvbpsi_
decoder_chain
_delete
(
p_dvbpsi
))
if
(
!
dvbpsi_
chain_demux
_delete
(
p_dvbpsi
))
ret
=
1
;
ret
=
1
;
dvbpsi_delete
(
p_dvbpsi
);
dvbpsi_delete
(
p_dvbpsi
);
}
}
...
...
examples/dvbinfo/libdvbpsi.c
View file @
3f0c670d
...
@@ -1950,7 +1950,7 @@ static void handle_atsc_MGT(void *p_data, dvbpsi_atsc_mgt_t *p_mgt)
...
@@ -1950,7 +1950,7 @@ static void handle_atsc_MGT(void *p_data, dvbpsi_atsc_mgt_t *p_mgt)
p
->
pid
->
i_pid
=
p_table
->
i_table_type_pid
;
p
->
pid
->
i_pid
=
p_table
->
i_table_type_pid
;
p
->
p_next
=
NULL
;
p
->
p_next
=
NULL
;
if
(
!
dvbpsi_
decoder_chain
_new
(
p
->
handle
,
handle_subtable
,
DeleteTableDecoder
,
p_stream
))
if
(
!
dvbpsi_
chain_demux
_new
(
p
->
handle
,
handle_subtable
,
DeleteTableDecoder
,
p_stream
))
{
{
fprintf
(
stderr
,
"dvbinfo: Failed to attach new ATSC EIT decoder
\n
"
);
fprintf
(
stderr
,
"dvbinfo: Failed to attach new ATSC EIT decoder
\n
"
);
dvbpsi_delete
(
p
->
handle
);
dvbpsi_delete
(
p
->
handle
);
...
@@ -2416,7 +2416,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
...
@@ -2416,7 +2416,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
stream
->
pat
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
stream
->
pat
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
if
(
stream
->
pat
.
handle
==
NULL
)
if
(
stream
->
pat
.
handle
==
NULL
)
goto
error
;
goto
error
;
if
(
!
dvbpsi_
decoder_chain
_new
(
stream
->
pat
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
if
(
!
dvbpsi_
chain_demux
_new
(
stream
->
pat
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
{
{
dvbpsi_delete
(
stream
->
pat
.
handle
);
dvbpsi_delete
(
stream
->
pat
.
handle
);
stream
->
pat
.
handle
=
NULL
;
stream
->
pat
.
handle
=
NULL
;
...
@@ -2426,7 +2426,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
...
@@ -2426,7 +2426,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
stream
->
cat
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
stream
->
cat
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
if
(
stream
->
cat
.
handle
==
NULL
)
if
(
stream
->
cat
.
handle
==
NULL
)
goto
error
;
goto
error
;
if
(
!
dvbpsi_
decoder_chain
_new
(
stream
->
cat
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
if
(
!
dvbpsi_
chain_demux
_new
(
stream
->
cat
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
{
{
dvbpsi_delete
(
stream
->
cat
.
handle
);
dvbpsi_delete
(
stream
->
cat
.
handle
);
stream
->
cat
.
handle
=
NULL
;
stream
->
cat
.
handle
=
NULL
;
...
@@ -2436,7 +2436,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
...
@@ -2436,7 +2436,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
stream
->
sdt
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
stream
->
sdt
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
if
(
stream
->
sdt
.
handle
==
NULL
)
if
(
stream
->
sdt
.
handle
==
NULL
)
goto
error
;
goto
error
;
if
(
!
dvbpsi_
decoder_chain
_new
(
stream
->
sdt
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
if
(
!
dvbpsi_
chain_demux
_new
(
stream
->
sdt
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
{
{
dvbpsi_delete
(
stream
->
sdt
.
handle
);
dvbpsi_delete
(
stream
->
sdt
.
handle
);
stream
->
sdt
.
handle
=
NULL
;
stream
->
sdt
.
handle
=
NULL
;
...
@@ -2446,7 +2446,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
...
@@ -2446,7 +2446,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
stream
->
rst
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
stream
->
rst
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
if
(
stream
->
rst
.
handle
==
NULL
)
if
(
stream
->
rst
.
handle
==
NULL
)
goto
error
;
goto
error
;
if
(
!
dvbpsi_
decoder_chain
_new
(
stream
->
rst
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
if
(
!
dvbpsi_
chain_demux
_new
(
stream
->
rst
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
{
{
dvbpsi_delete
(
stream
->
rst
.
handle
);
dvbpsi_delete
(
stream
->
rst
.
handle
);
stream
->
rst
.
handle
=
NULL
;
stream
->
rst
.
handle
=
NULL
;
...
@@ -2456,7 +2456,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
...
@@ -2456,7 +2456,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
stream
->
eit
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
stream
->
eit
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
if
(
stream
->
eit
.
handle
==
NULL
)
if
(
stream
->
eit
.
handle
==
NULL
)
goto
error
;
goto
error
;
if
(
!
dvbpsi_
decoder_chain
_new
(
stream
->
eit
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
if
(
!
dvbpsi_
chain_demux
_new
(
stream
->
eit
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
{
{
dvbpsi_delete
(
stream
->
eit
.
handle
);
dvbpsi_delete
(
stream
->
eit
.
handle
);
stream
->
eit
.
handle
=
NULL
;
stream
->
eit
.
handle
=
NULL
;
...
@@ -2466,7 +2466,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
...
@@ -2466,7 +2466,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
stream
->
tdt
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
stream
->
tdt
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
if
(
stream
->
tdt
.
handle
==
NULL
)
if
(
stream
->
tdt
.
handle
==
NULL
)
goto
error
;
goto
error
;
if
(
!
dvbpsi_
decoder_chain
_new
(
stream
->
tdt
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
if
(
!
dvbpsi_
chain_demux
_new
(
stream
->
tdt
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
{
{
dvbpsi_delete
(
stream
->
tdt
.
handle
);
dvbpsi_delete
(
stream
->
tdt
.
handle
);
stream
->
tdt
.
handle
=
NULL
;
stream
->
tdt
.
handle
=
NULL
;
...
@@ -2477,7 +2477,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
...
@@ -2477,7 +2477,7 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
stream
->
atsc
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
stream
->
atsc
.
handle
=
dvbpsi_new
(
&
dvbpsi_message
,
stream
->
level
);
if
(
stream
->
atsc
.
handle
==
NULL
)
if
(
stream
->
atsc
.
handle
==
NULL
)
goto
error
;
goto
error
;
if
(
!
dvbpsi_
decoder_chain
_new
(
stream
->
atsc
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
if
(
!
dvbpsi_
chain_demux
_new
(
stream
->
atsc
.
handle
,
handle_subtable
,
DeleteTableDecoder
,
stream
))
{
{
dvbpsi_delete
(
stream
->
atsc
.
handle
);
dvbpsi_delete
(
stream
->
atsc
.
handle
);
stream
->
atsc
.
handle
=
NULL
;
stream
->
atsc
.
handle
=
NULL
;
...
@@ -2499,19 +2499,19 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
...
@@ -2499,19 +2499,19 @@ ts_stream_t *libdvbpsi_init(int debug, ts_stream_log_cb pf_log, void *cb_data)
return
stream
;
return
stream
;
error:
error:
if
(
dvbpsi_
decoder_chain
_delete
(
stream
->
pat
.
handle
))
if
(
dvbpsi_
chain_demux
_delete
(
stream
->
pat
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete PAT decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete PAT decoder chain! .. possibly leaking memory!!
\n
"
);
if
(
dvbpsi_
decoder_chain
_delete
(
stream
->
cat
.
handle
))
if
(
dvbpsi_
chain_demux
_delete
(
stream
->
cat
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete CAT decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete CAT decoder chain! .. possibly leaking memory!!
\n
"
);
if
(
dvbpsi_
decoder_chain
_delete
(
stream
->
sdt
.
handle
))
if
(
dvbpsi_
chain_demux
_delete
(
stream
->
sdt
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete SDT decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete SDT decoder chain! .. possibly leaking memory!!
\n
"
);
if
(
dvbpsi_
decoder_chain
_delete
(
stream
->
eit
.
handle
))
if
(
dvbpsi_
chain_demux
_delete
(
stream
->
eit
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete EIT decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete EIT decoder chain! .. possibly leaking memory!!
\n
"
);
if
(
dvbpsi_
decoder_chain
_delete
(
stream
->
rst
.
handle
))
if
(
dvbpsi_
chain_demux
_delete
(
stream
->
rst
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete RST decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete RST decoder chain! .. possibly leaking memory!!
\n
"
);
if
(
dvbpsi_
decoder_chain
_delete
(
stream
->
tdt
.
handle
))
if
(
dvbpsi_
chain_demux
_delete
(
stream
->
tdt
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete TDT decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete TDT decoder chain! .. possibly leaking memory!!
\n
"
);
if
(
dvbpsi_
decoder_chain
_delete
(
stream
->
atsc
.
handle
))
if
(
dvbpsi_
chain_demux
_delete
(
stream
->
atsc
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete ATSC decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete ATSC decoder chain! .. possibly leaking memory!!
\n
"
);
if
(
stream
->
pat
.
handle
)
if
(
stream
->
pat
.
handle
)
...
@@ -2538,7 +2538,7 @@ void libdvbpsi_exit(ts_stream_t *stream)
...
@@ -2538,7 +2538,7 @@ void libdvbpsi_exit(ts_stream_t *stream)
{
{
summary
(
stdout
,
stream
);
summary
(
stdout
,
stream
);
if
(
!
dvbpsi_
decoder_chain
_delete
(
stream
->
pat
.
handle
))
if
(
!
dvbpsi_
chain_demux
_delete
(
stream
->
pat
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete PAT decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete PAT decoder chain! .. possibly leaking memory!!
\n
"
);
ts_pmt_t
*
p_pmt
=
stream
->
pmt
;
ts_pmt_t
*
p_pmt
=
stream
->
pmt
;
...
@@ -2546,7 +2546,7 @@ void libdvbpsi_exit(ts_stream_t *stream)
...
@@ -2546,7 +2546,7 @@ void libdvbpsi_exit(ts_stream_t *stream)
while
(
p_pmt
)
while
(
p_pmt
)
{
{
dvbpsi_t
*
handle
=
p_pmt
->
handle
;
dvbpsi_t
*
handle
=
p_pmt
->
handle
;
if
(
!
dvbpsi_
decoder_chain
_delete
(
handle
))
if
(
!
dvbpsi_
chain_demux
_delete
(
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete PMT decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete PMT decoder chain! .. possibly leaking memory!!
\n
"
);
dvbpsi_delete
(
p_pmt
->
handle
);
dvbpsi_delete
(
p_pmt
->
handle
);
...
@@ -2563,7 +2563,7 @@ void libdvbpsi_exit(ts_stream_t *stream)
...
@@ -2563,7 +2563,7 @@ void libdvbpsi_exit(ts_stream_t *stream)
while
(
p_atsc_eit
)
while
(
p_atsc_eit
)
{
{
dvbpsi_t
*
handle
=
p_atsc_eit
->
handle
;
dvbpsi_t
*
handle
=
p_atsc_eit
->
handle
;
if
(
!
dvbpsi_
decoder_chain
_delete
(
handle
))
if
(
!
dvbpsi_
chain_demux
_delete
(
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete EIT decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete EIT decoder chain! .. possibly leaking memory!!
\n
"
);
dvbpsi_delete
(
p_atsc_eit
->
handle
);
dvbpsi_delete
(
p_atsc_eit
->
handle
);
...
@@ -2575,17 +2575,17 @@ void libdvbpsi_exit(ts_stream_t *stream)
...
@@ -2575,17 +2575,17 @@ void libdvbpsi_exit(ts_stream_t *stream)
free
(
p_atsc_prev
);
free
(
p_atsc_prev
);
}
}
if
(
!
dvbpsi_
decoder_chain
_delete
(
stream
->
cat
.
handle
))
if
(
!
dvbpsi_
chain_demux
_delete
(
stream
->
cat
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete CAT decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete CAT decoder chain! .. possibly leaking memory!!
\n
"
);
if
(
!
dvbpsi_
decoder_chain
_delete
(
stream
->
sdt
.
handle
))
if
(
!
dvbpsi_
chain_demux
_delete
(
stream
->
sdt
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete SDT decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete SDT decoder chain! .. possibly leaking memory!!
\n
"
);
if
(
!
dvbpsi_
decoder_chain
_delete
(
stream
->
eit
.
handle
))
if
(
!
dvbpsi_
chain_demux
_delete
(
stream
->
eit
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete EIT decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete EIT decoder chain! .. possibly leaking memory!!
\n
"
);
if
(
!
dvbpsi_
decoder_chain
_delete
(
stream
->
rst
.
handle
))
if
(
!
dvbpsi_
chain_demux
_delete
(
stream
->
rst
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete RST decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete RST decoder chain! .. possibly leaking memory!!
\n
"
);
if
(
!
dvbpsi_
decoder_chain
_delete
(
stream
->
tdt
.
handle
))
if
(
!
dvbpsi_
chain_demux
_delete
(
stream
->
tdt
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete TDT decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete TDT decoder chain! .. possibly leaking memory!!
\n
"
);
if
(
!
dvbpsi_
decoder_chain
_delete
(
stream
->
atsc
.
handle
))
if
(
!
dvbpsi_
chain_demux
_delete
(
stream
->
atsc
.
handle
))
fprintf
(
stderr
,
"dvbinfo: failed to delete ATSC decoder chain! .. possibly leaking memory!!
\n
"
);
fprintf
(
stderr
,
"dvbinfo: failed to delete ATSC decoder chain! .. possibly leaking memory!!
\n
"
);
if
(
stream
->
pat
.
handle
)
if
(
stream
->
pat
.
handle
)
...
...
src/chain.c
View file @
3f0c670d
...
@@ -76,11 +76,11 @@ static void dvbpsi_decoder_chain_demux(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t
...
@@ -76,11 +76,11 @@ static void dvbpsi_decoder_chain_demux(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t
}
}
/*****************************************************************************
/*****************************************************************************
* dvbpsi_
decoder_chain
_new
* dvbpsi_
chain_demux
_new
*****************************************************************************
*****************************************************************************
* Create chain decoder
* Create chain de
mux de
coder
*****************************************************************************/
*****************************************************************************/
bool
dvbpsi_
decoder_chain
_new
(
dvbpsi_t
*
p_dvbpsi
,
dvbpsi_callback_new_t
pf_new
,
bool
dvbpsi_
chain_demux
_new
(
dvbpsi_t
*
p_dvbpsi
,
dvbpsi_callback_new_t
pf_new
,
dvbpsi_callback_del_t
pf_del
,
void
*
p_data
)
dvbpsi_callback_del_t
pf_del
,
void
*
p_data
)
{
{
if
(
p_dvbpsi
->
p_decoder
)
{
if
(
p_dvbpsi
->
p_decoder
)
{
...
@@ -88,7 +88,6 @@ bool dvbpsi_decoder_chain_new(dvbpsi_t *p_dvbpsi, dvbpsi_callback_new_t pf_new,
...
@@ -88,7 +88,6 @@ bool dvbpsi_decoder_chain_new(dvbpsi_t *p_dvbpsi, dvbpsi_callback_new_t pf_new,
return
false
;
return
false
;
}
}
/* FIXME: We need an alternative for dvbpsi_Demux() !!!*/
dvbpsi_decoder_t
*
p_chain
=
(
dvbpsi_decoder_t
*
)
dvbpsi_decoder_new
(
&
dvbpsi_decoder_chain_demux
,
dvbpsi_decoder_t
*
p_chain
=
(
dvbpsi_decoder_t
*
)
dvbpsi_decoder_new
(
&
dvbpsi_decoder_chain_demux
,
4096
,
true
,
4096
,
true
,
sizeof
(
dvbpsi_decoder_t
));
sizeof
(
dvbpsi_decoder_t
));
...
@@ -105,13 +104,14 @@ bool dvbpsi_decoder_chain_new(dvbpsi_t *p_dvbpsi, dvbpsi_callback_new_t pf_new,
...
@@ -105,13 +104,14 @@ bool dvbpsi_decoder_chain_new(dvbpsi_t *p_dvbpsi, dvbpsi_callback_new_t pf_new,
}
}
/*****************************************************************************
/*****************************************************************************
* dvbpsi_
decoder_chain
_delete
* dvbpsi_
chain_demux
_delete
*****************************************************************************
*****************************************************************************
* Remove all decoders from list and free all resources.
* Remove all decoders from list and free all resources.
*****************************************************************************/
*****************************************************************************/
bool
dvbpsi_
decoder_chain
_delete
(
dvbpsi_t
*
p_dvbpsi
)
bool
dvbpsi_
chain_demux
_delete
(
dvbpsi_t
*
p_dvbpsi
)
{
{
dvbpsi_decoder_t
*
p
=
p_dvbpsi
->
p_decoder
;
dvbpsi_decoder_t
*
p_demux
=
p_dvbpsi
->
p_decoder
;
dvbpsi_decoder_t
*
p
=
p_demux
->
p_next
;
/* First subtable decoder */
if
(
!
p
)
return
false
;
if
(
!
p
)
return
false
;
while
(
p
)
{
while
(
p
)
{
...
@@ -125,6 +125,9 @@ bool dvbpsi_decoder_chain_delete(dvbpsi_t *p_dvbpsi)
...
@@ -125,6 +125,9 @@ bool dvbpsi_decoder_chain_delete(dvbpsi_t *p_dvbpsi)
*/
*/
else
dvbpsi_decoder_delete
(
p_dec
);
else
dvbpsi_decoder_delete
(
p_dec
);
}
}
/* Delete demux decoder */
dvbpsi_decoder_delete
(
p_demux
);
p_dvbpsi
->
p_decoder
=
NULL
;
p_dvbpsi
->
p_decoder
=
NULL
;
return
true
;
return
true
;
}
}
...
@@ -185,6 +188,7 @@ bool dvbpsi_decoder_chain_remove(dvbpsi_t *p_dvbpsi, const dvbpsi_decoder_t *p_d
...
@@ -185,6 +188,7 @@ bool dvbpsi_decoder_chain_remove(dvbpsi_t *p_dvbpsi, const dvbpsi_decoder_t *p_d
while
(
pp_prev
)
{
while
(
pp_prev
)
{
if
((
p_decoder
->
i_table_id
==
(
*
pp_prev
)
->
i_table_id
)
&&
if
((
p_decoder
->
i_table_id
==
(
*
pp_prev
)
->
i_table_id
)
&&
(
p_decoder
->
i_extension
==
(
*
pp_prev
)
->
i_extension
))
{
(
p_decoder
->
i_extension
==
(
*
pp_prev
)
->
i_extension
))
{
assert
(
*
pp_prev
==
p_decoder
);
*
pp_prev
=
p_decoder
->
p_next
;
*
pp_prev
=
p_decoder
->
p_next
;
/* NOTE: caller must call dvbpsi_decoder_delete(p_decoder) */
/* NOTE: caller must call dvbpsi_decoder_delete(p_decoder) */
return
true
;
return
true
;
...
...
src/chain.h
View file @
3f0c670d
...
@@ -40,12 +40,12 @@ extern "C" {
...
@@ -40,12 +40,12 @@ extern "C" {
#endif
#endif
/*****************************************************************************
/*****************************************************************************
* dvbpsi_
decoder_chain
_new
* dvbpsi_
chain_demux
_new
*****************************************************************************/
*****************************************************************************/
/*!
/*!
* \fn bool dvbpsi_
decoder_chain
_new(dvbpsi_t *p_dvbpsi, dvbpsi_callback_new_t *pf_new,
* \fn bool dvbpsi_
chain_demux
_new(dvbpsi_t *p_dvbpsi, dvbpsi_callback_new_t *pf_new,
dvbpsi_callback_del_t *pf_del, void *p_data)
dvbpsi_callback_del_t *pf_del, void *p_data)
* \brief dvbpsi_
decoder_chain
_new creates a decoder for demuxing PSI tables and subtables.
* \brief dvbpsi_
chain_demux
_new creates a decoder for demuxing PSI tables and subtables.
* \param p_dvbpsi pointer to dvbpsi_t handle
* \param p_dvbpsi pointer to dvbpsi_t handle
* \param pf_new callback function for calling the specific PSI table/subtable attach function
* \param pf_new callback function for calling the specific PSI table/subtable attach function
* \param pf_del callback function for calling the specific PSI table/subtable detach function
* \param pf_del callback function for calling the specific PSI table/subtable detach function
...
@@ -53,22 +53,22 @@ extern "C" {
...
@@ -53,22 +53,22 @@ extern "C" {
* dvbpsi_xxx_attach() function
* dvbpsi_xxx_attach() function
* \return true on success, false on failure
* \return true on success, false on failure
*/
*/
bool
dvbpsi_
decoder_chain
_new
(
dvbpsi_t
*
p_dvbpsi
,
dvbpsi_callback_new_t
pf_new
,
bool
dvbpsi_
chain_demux
_new
(
dvbpsi_t
*
p_dvbpsi
,
dvbpsi_callback_new_t
pf_new
,
dvbpsi_callback_del_t
pf_del
,
void
*
p_data
);
dvbpsi_callback_del_t
pf_del
,
void
*
p_data
);
/*****************************************************************************
/*****************************************************************************
* dvbpsi_
decoder_chain
_delete
* dvbpsi_
chain_demux
_delete
*****************************************************************************/
*****************************************************************************/
/*!
/*!
* \fn bool dvbpsi_
decoder_chain
_delete(dvbpsi_t *p_dvbpsi)
* \fn bool dvbpsi_
chain_demux
_delete(dvbpsi_t *p_dvbpsi)
* \brief dvbpsi_
decoder_chain
_delete walks the chain of PSI (sub-)table decoders
* \brief dvbpsi_
chain_demux
_delete walks the chain of PSI (sub-)table decoders
* and removes them from the chain before calling its pf_detach callback. The pointers
* and removes them from the chain before calling its pf_detach callback. The pointers
* to the PSI (sub-)table decoders are no longer valid after this function has been called.
* to the PSI (sub-)table decoders are no longer valid after this function has been called.
* Nor is the decoder chain list valid.
* Nor is the decoder chain list valid.
* \param p_dvbpsi pointer to dvbpsi_t handle
* \param p_dvbpsi pointer to dvbpsi_t handle
* \return true on success, false on failure
* \return true on success, false on failure
*/
*/
bool
dvbpsi_
decoder_chain
_delete
(
dvbpsi_t
*
p_dvbpsi
);
bool
dvbpsi_
chain_demux
_delete
(
dvbpsi_t
*
p_dvbpsi
);
/*****************************************************************************
/*****************************************************************************
* dvbpsi_decoder_chain_add
* dvbpsi_decoder_chain_add
...
...
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