mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
dvb: Fix PMT handling
Was using an older (temporary) version of the mpegts library API.
This commit is contained in:
parent
b7bba5658a
commit
32f33c9448
1 changed files with 24 additions and 10 deletions
|
@ -85,8 +85,10 @@ typedef struct
|
||||||
gint program_number;
|
gint program_number;
|
||||||
guint16 pmt_pid;
|
guint16 pmt_pid;
|
||||||
guint16 pcr_pid;
|
guint16 pcr_pid;
|
||||||
GstMpegTsPMT *pmt;
|
GstMpegTsSection *section;
|
||||||
GstMpegTsPMT *old_pmt;
|
GstMpegTsSection *old_section;
|
||||||
|
const GstMpegTsPMT *pmt;
|
||||||
|
const GstMpegTsPMT *old_pmt;
|
||||||
gboolean selected;
|
gboolean selected;
|
||||||
gboolean pmt_active;
|
gboolean pmt_active;
|
||||||
gboolean active;
|
gboolean active;
|
||||||
|
@ -661,7 +663,8 @@ dvb_base_bin_rebuild_filter (DvbBaseBin * dvbbasebin)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dvb_base_bin_remove_pmt_streams (DvbBaseBin * dvbbasebin, GstMpegTsPMT * pmt)
|
dvb_base_bin_remove_pmt_streams (DvbBaseBin * dvbbasebin,
|
||||||
|
const GstMpegTsPMT * pmt)
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
DvbBaseBinStream *stream;
|
DvbBaseBinStream *stream;
|
||||||
|
@ -681,7 +684,7 @@ dvb_base_bin_remove_pmt_streams (DvbBaseBin * dvbbasebin, GstMpegTsPMT * pmt)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dvb_base_bin_add_pmt_streams (DvbBaseBin * dvbbasebin, GstMpegTsPMT * pmt)
|
dvb_base_bin_add_pmt_streams (DvbBaseBin * dvbbasebin, const GstMpegTsPMT * pmt)
|
||||||
{
|
{
|
||||||
DvbBaseBinStream *stream;
|
DvbBaseBinStream *stream;
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -735,7 +738,8 @@ dvb_base_bin_activate_program (DvbBaseBin * dvbbasebin,
|
||||||
stream->usecount += 1;
|
stream->usecount += 1;
|
||||||
|
|
||||||
dvb_base_bin_add_pmt_streams (dvbbasebin, program->pmt);
|
dvb_base_bin_add_pmt_streams (dvbbasebin, program->pmt);
|
||||||
dvbbasebin->pmtlist = g_list_append (dvbbasebin->pmtlist, program->pmt);
|
dvbbasebin->pmtlist =
|
||||||
|
g_list_append (dvbbasebin->pmtlist, (gpointer) program->pmt);
|
||||||
dvbbasebin->pmtlist_changed = TRUE;
|
dvbbasebin->pmtlist_changed = TRUE;
|
||||||
program->active = TRUE;
|
program->active = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -846,10 +850,16 @@ dvb_base_bin_pat_info_cb (DvbBaseBin * dvbbasebin, GstMpegTsSection * section)
|
||||||
static void
|
static void
|
||||||
dvb_base_bin_pmt_info_cb (DvbBaseBin * dvbbasebin, GstMpegTsSection * section)
|
dvb_base_bin_pmt_info_cb (DvbBaseBin * dvbbasebin, GstMpegTsSection * section)
|
||||||
{
|
{
|
||||||
GstMpegTsPMT *pmt = (GstMpegTsPMT *) section;
|
const GstMpegTsPMT *pmt;
|
||||||
DvbBaseBinProgram *program;
|
DvbBaseBinProgram *program;
|
||||||
guint program_number;
|
guint program_number;
|
||||||
|
|
||||||
|
pmt = gst_mpegts_section_get_pmt (section);
|
||||||
|
if (G_UNLIKELY (pmt == NULL)) {
|
||||||
|
GST_WARNING_OBJECT (dvbbasebin, "Received invalid PMT");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
program_number = section->subtable_extension;
|
program_number = section->subtable_extension;
|
||||||
|
|
||||||
program = dvb_base_bin_get_program (dvbbasebin, program_number);
|
program = dvb_base_bin_get_program (dvbbasebin, program_number);
|
||||||
|
@ -860,7 +870,9 @@ dvb_base_bin_pmt_info_cb (DvbBaseBin * dvbbasebin, GstMpegTsSection * section)
|
||||||
}
|
}
|
||||||
|
|
||||||
program->old_pmt = program->pmt;
|
program->old_pmt = program->pmt;
|
||||||
program->pmt = (GstMpegTsPMT *) gst_mpegts_section_ref (pmt);
|
program->old_section = program->section;
|
||||||
|
program->pmt = pmt;
|
||||||
|
program->section = gst_mpegts_section_ref (section);
|
||||||
|
|
||||||
/* activate the program if it's selected and either it's not active or its pmt
|
/* activate the program if it's selected and either it's not active or its pmt
|
||||||
* changed */
|
* changed */
|
||||||
|
@ -868,7 +880,7 @@ dvb_base_bin_pmt_info_cb (DvbBaseBin * dvbbasebin, GstMpegTsSection * section)
|
||||||
dvb_base_bin_activate_program (dvbbasebin, program);
|
dvb_base_bin_activate_program (dvbbasebin, program);
|
||||||
|
|
||||||
if (program->old_pmt) {
|
if (program->old_pmt) {
|
||||||
gst_mpegts_section_unref (program->old_pmt);
|
gst_mpegts_section_unref (program->old_section);
|
||||||
program->old_pmt = NULL;
|
program->old_pmt = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -964,8 +976,10 @@ dvb_base_bin_program_destroy (gpointer data)
|
||||||
|
|
||||||
program = (DvbBaseBinProgram *) data;
|
program = (DvbBaseBinProgram *) data;
|
||||||
|
|
||||||
if (program->pmt)
|
if (program->pmt) {
|
||||||
gst_mpegts_section_unref (program->pmt);
|
program->pmt = NULL;
|
||||||
|
gst_mpegts_section_unref (program->section);
|
||||||
|
}
|
||||||
|
|
||||||
g_free (program);
|
g_free (program);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue