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

PMT: remove extra argument from dvbpsi_pmt_attach()

By removing the i_program_number argument from dvbpsi_pmt_attach() its prototype then
matches that of all other dvbpsi_*_attach() functions. The i_extension was already used
as being the program number in case of PMT tables since the beginning of libdvbpsi its
implementation.
parent 1781bee6
...@@ -280,7 +280,7 @@ int main(int i_argc, char* pa_argv[]) ...@@ -280,7 +280,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_pmt_attach(p_dvbpsi, 0x02, i_program_number, i_program_number, DumpPMT, NULL)) if (!dvbpsi_pmt_attach(p_dvbpsi, 0x02, i_program_number, DumpPMT, NULL))
goto out; goto out;
b_ok = ReadPacket(i_fd, data); b_ok = ReadPacket(i_fd, data);
......
...@@ -760,7 +760,7 @@ static void handle_PAT(void* p_data, dvbpsi_pat_t* p_pat) ...@@ -760,7 +760,7 @@ static void handle_PAT(void* p_data, dvbpsi_pat_t* p_pat)
/* PMT table_id == 0x02 and extenion == p_program->i_number */ /* PMT table_id == 0x02 and extenion == p_program->i_number */
if (!dvbpsi_pmt_attach(p_pmt->handle, 0x02, p_program->i_number, if (!dvbpsi_pmt_attach(p_pmt->handle, 0x02, p_program->i_number,
p_program->i_number, handle_PMT, p_stream)) handle_PMT, p_stream))
{ {
fprintf(stderr, "dvbinfo: Failed to attach new pmt decoder\n"); fprintf(stderr, "dvbinfo: Failed to attach new pmt decoder\n");
dvbpsi_delete(p_pmt->handle); dvbpsi_delete(p_pmt->handle);
......
...@@ -124,7 +124,7 @@ static void PATCallback( void *_unused, dvbpsi_pat_t *p_pat ) ...@@ -124,7 +124,7 @@ static void PATCallback( void *_unused, dvbpsi_pat_t *p_pat )
p_pmt_dvbpsi_fds[i_nb_programs] = dvbpsi_new(&message, DVBPSI_MSG_DEBUG); p_pmt_dvbpsi_fds[i_nb_programs] = dvbpsi_new(&message, DVBPSI_MSG_DEBUG);
if (p_pmt_dvbpsi_fds[i_nb_programs]) if (p_pmt_dvbpsi_fds[i_nb_programs])
{ {
if (dvbpsi_pmt_attach(p_pmt_dvbpsi_fds[i_nb_programs], 0x02, 0x0, if (dvbpsi_pmt_attach(p_pmt_dvbpsi_fds[i_nb_programs], 0x02,
p_program->i_number, PMTCallback, NULL)) p_program->i_number, PMTCallback, NULL))
i_nb_programs++; i_nb_programs++;
} }
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
* Initialize a PMT decoder and return a handle on it. * Initialize a PMT decoder and return a handle on it.
*****************************************************************************/ *****************************************************************************/
bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension, bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
uint16_t i_program_number, dvbpsi_pmt_callback pf_callback, void* p_cb_data) dvbpsi_pmt_callback pf_callback, void* p_cb_data)
{ {
assert(p_dvbpsi); assert(p_dvbpsi);
...@@ -75,7 +75,7 @@ bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extens ...@@ -75,7 +75,7 @@ bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extens
return false; return false;
/* PMT decoder configuration */ /* PMT decoder configuration */
p_pmt_decoder->i_program_number = i_program_number; p_pmt_decoder->i_program_number = i_extension;
p_pmt_decoder->pf_pmt_callback = pf_callback; p_pmt_decoder->pf_pmt_callback = pf_callback;
p_pmt_decoder->p_cb_data = p_cb_data; p_pmt_decoder->p_cb_data = p_cb_data;
p_pmt_decoder->p_building_pmt = NULL; p_pmt_decoder->p_building_pmt = NULL;
......
...@@ -109,21 +109,19 @@ typedef void (* dvbpsi_pmt_callback)(void* p_cb_data, dvbpsi_pmt_t* p_new_pmt); ...@@ -109,21 +109,19 @@ typedef void (* dvbpsi_pmt_callback)(void* p_cb_data, dvbpsi_pmt_t* p_new_pmt);
* \fn bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, * \fn bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi,
* uint8_t i_table_id, * uint8_t i_table_id,
* uint16_t i_extension, * uint16_t i_extension,
uint16_t i_program_number,
dvbpsi_pmt_callback pf_callback, dvbpsi_pmt_callback pf_callback,
void* p_cb_data) void* p_cb_data)
* \brief Creates and initialization of a PMT decoder and attaches it to dvbpsi_t * \brief Creates and initialization of a PMT decoder and attaches it to dvbpsi_t
* handle * handle
* \param p_dvbpsi handle * \param p_dvbpsi handle
* \param i_table_id Table ID * \param i_table_id Table ID
* \param i_extension Table ID extension * \param i_extension Normally Table ID extension number,
* \param i_program_number program number * but for PMT's it is the program_number;
* \param pf_callback function to call back on new PMT * \param pf_callback function to call back on new PMT
* \param p_cb_data private data given in argument to the callback * \param p_cb_data private data given in argument to the callback
* \return true on success, false on failure * \return true on success, false on failure
*/ */
bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension, bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
uint16_t i_program_number,
dvbpsi_pmt_callback pf_callback, void* p_cb_data); dvbpsi_pmt_callback pf_callback, void* p_cb_data);
/***************************************************************************** /*****************************************************************************
...@@ -134,7 +132,8 @@ bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extens ...@@ -134,7 +132,8 @@ bool dvbpsi_pmt_attach(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extens
* \brief Destroy a PMT decoder. * \brief Destroy a PMT decoder.
* \param p_dvbpsi handle * \param p_dvbpsi handle
* \param i_table_id Table ID * \param i_table_id Table ID
* \param i_extension Table ID extension * \param i_extension Normally Table ID extension number,
* but for PMT's it is the program_number;
* \return nothing. * \return nothing.
* *
* The handle isn't valid any more. * The handle isn't valid any more.
......
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