mpegtsbase/tsdemux: Add more comments and removal unused variable

This commit is contained in:
Edward Hervey 2011-07-19 09:36:53 +02:00
parent 2b127601e9
commit a960e72efa
2 changed files with 12 additions and 4 deletions

View file

@ -369,6 +369,9 @@ mpegts_base_add_program (MpegTSBase * base,
{
MpegTSBaseProgram *program;
GST_DEBUG_OBJECT (base, "program_number : %d, pmt_pid : %d",
program_number, pmt_pid);
program = g_malloc0 (base->program_size);
program->program_number = program_number;
program->pmt_pid = pmt_pid;
@ -456,6 +459,8 @@ mpegts_base_remove_program (MpegTSBase * base, gint program_number)
MpegTSBaseProgram *program;
MpegTSBaseClass *klass = GST_MPEGTS_BASE_GET_CLASS (base);
GST_DEBUG_OBJECT (base, "program_number : %d", program_number);
if (klass->program_stopped) {
program =
(MpegTSBaseProgram *) g_hash_table_lookup (base->programs,
@ -464,7 +469,6 @@ mpegts_base_remove_program (MpegTSBase * base, gint program_number)
klass->program_stopped (base, program);
}
g_hash_table_remove (base->programs, GINT_TO_POINTER (program_number));
}
static MpegTSBaseStream *
@ -535,6 +539,8 @@ mpegts_base_deactivate_pmt (MpegTSBase * base, MpegTSBaseProgram * program)
const GValue *value;
MpegTSBaseClass *klass = GST_MPEGTS_BASE_GET_CLASS (base);
GST_DEBUG_OBJECT (base, "Deactivating PMT");
if (program->pmt_info) {
/* Inform subclasses we're deactivating this program */
if (klass->program_stopped)
@ -732,6 +738,8 @@ mpegts_base_apply_pmt (MpegTSBase * base,
return;
}
GST_DEBUG ("Applying PMT (pid:0x%04x)", pmt_pid);
gst_structure_id_get (pmt_info,
QUARK_PROGRAM_NUMBER, G_TYPE_UINT, &program_number,
QUARK_PCR_PID, G_TYPE_UINT, &pcr_pid, NULL);
@ -739,6 +747,7 @@ mpegts_base_apply_pmt (MpegTSBase * base,
program = mpegts_base_get_program (base, program_number);
if (program) {
GST_DEBUG ("Deactivating old program");
/* deactivate old pmt */ ;
mpegts_base_deactivate_pmt (base, program);
if (program->pmt_info)
@ -750,6 +759,8 @@ mpegts_base_apply_pmt (MpegTSBase * base,
program = mpegts_base_add_program (base, program_number, pid);
}
GST_DEBUG ("Now activating new program");
/* activate new pmt */
program->pmt_info = gst_structure_copy (pmt_info);
program->pmt_pid = pmt_pid;

View file

@ -92,9 +92,6 @@ struct _TSDemuxStream
GstPad *pad;
/* set to FALSE before a push and TRUE after */
gboolean pushed;
/* the return of the latest push */
GstFlowReturn flow_return;