Commit a437933a authored by Jean-Paul Saman's avatar Jean-Paul Saman

examples/get_pcr_pid.c: Fail if attaching PMT decoder fails.

(cherry picked from commit 1923bd300f7b3c24c54979c090471961d71a667b)
parent c482d192
...@@ -170,6 +170,8 @@ int main( int i_argc, char **pp_argv ) ...@@ -170,6 +170,8 @@ int main( int i_argc, char **pp_argv )
i_program = strtol( pp_argv[2], NULL, 0 ); i_program = strtol( pp_argv[2], NULL, 0 );
p_pat_dvbpsi_fd = dvbpsi_AttachPAT( PATCallback, NULL ); p_pat_dvbpsi_fd = dvbpsi_AttachPAT( PATCallback, NULL );
if ( p_pat_dvbpsi_fd == NULL )
goto out;
p_buffer = malloc( TS_SIZE * READ_ONCE ); p_buffer = malloc( TS_SIZE * READ_ONCE );
if ( p_buffer == NULL ) if ( p_buffer == NULL )
...@@ -200,6 +202,7 @@ int main( int i_argc, char **pp_argv ) ...@@ -200,6 +202,7 @@ int main( int i_argc, char **pp_argv )
free( p_buffer ); free( p_buffer );
out: out:
if ( p_dvbpsi_fd ) dvbpsi_DetachPAT( p_dvbpsi_fd );
close( i_fd ); close( i_fd );
fprintf( stderr, "no PAT/PMT found\n" ); fprintf( stderr, "no PAT/PMT found\n" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment