mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 06:16:36 +00:00
mpegtsmux: Explicitly resend PAT/SI/PMT on force-keyunit events
And don't randomly change the PCR stream, which would cause a new PMT version to be generated instead and could confuse players.
This commit is contained in:
parent
3f0463c43e
commit
93e56ed473
3 changed files with 50 additions and 4 deletions
|
@ -1378,16 +1378,16 @@ mpegtsmux_collected_buffer (GstCollectPads * pads, GstCollectData * data,
|
|||
GST_TIME_ARGS (running_time), count);
|
||||
gst_pad_push_event (mux->srcpad, event);
|
||||
|
||||
/* output PAT */
|
||||
mux->tsmux->last_pat_ts = -1;
|
||||
/* output PAT, SI tables */
|
||||
tsmux_resend_pat (mux->tsmux);
|
||||
tsmux_resend_si (mux->tsmux);
|
||||
|
||||
/* output PMT for each program */
|
||||
for (cur = mux->tsmux->programs; cur; cur = cur->next) {
|
||||
TsMuxProgram *program = (TsMuxProgram *) cur->data;
|
||||
|
||||
program->last_pmt_ts = -1;
|
||||
tsmux_resend_pmt (program);
|
||||
}
|
||||
tsmux_program_set_pcr_stream (prog, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -228,6 +228,20 @@ tsmux_get_pat_interval (TsMux * mux)
|
|||
return mux->pat_interval;
|
||||
}
|
||||
|
||||
/**
|
||||
* tsmux_resend_pat:
|
||||
* @mux: a #TsMux
|
||||
*
|
||||
* Resends the PAT before the next stream packet.
|
||||
*/
|
||||
void
|
||||
tsmux_resend_pat (TsMux * mux)
|
||||
{
|
||||
g_return_if_fail (mux != NULL);
|
||||
|
||||
mux->last_pat_ts = G_MININT64;
|
||||
}
|
||||
|
||||
/**
|
||||
* tsmux_set_si_interval:
|
||||
* @mux: a #TsMux
|
||||
|
@ -260,6 +274,21 @@ tsmux_get_si_interval (TsMux * mux)
|
|||
return mux->si_interval;
|
||||
}
|
||||
|
||||
/**
|
||||
* tsmux_resend_si:
|
||||
* @mux: a #TsMux
|
||||
*
|
||||
* Resends the SI tables before the next stream packet.
|
||||
*
|
||||
*/
|
||||
void
|
||||
tsmux_resend_si (TsMux * mux)
|
||||
{
|
||||
g_return_if_fail (mux != NULL);
|
||||
|
||||
mux->last_si_ts = G_MININT64;
|
||||
}
|
||||
|
||||
/**
|
||||
* tsmux_add_mpegts_si_section:
|
||||
* @mux: a #TsMux
|
||||
|
@ -427,6 +456,20 @@ tsmux_get_pmt_interval (TsMuxProgram * program)
|
|||
return program->pmt_interval;
|
||||
}
|
||||
|
||||
/**
|
||||
* tsmux_resend_pmt:
|
||||
* @program: a #TsMuxProgram
|
||||
*
|
||||
* Resends the PMT before the next stream packet.
|
||||
*/
|
||||
void
|
||||
tsmux_resend_pmt (TsMuxProgram * program)
|
||||
{
|
||||
g_return_if_fail (program != NULL);
|
||||
|
||||
program->last_pmt_ts = G_MININT64;
|
||||
}
|
||||
|
||||
/**
|
||||
* tsmux_program_add_stream:
|
||||
* @program: a #TsMuxProgram
|
||||
|
|
|
@ -189,6 +189,7 @@ void tsmux_set_write_func (TsMux *mux, TsMuxWriteFunc func, void *user_data)
|
|||
void tsmux_set_alloc_func (TsMux *mux, TsMuxAllocFunc func, void *user_data);
|
||||
void tsmux_set_pat_interval (TsMux *mux, guint interval);
|
||||
guint tsmux_get_pat_interval (TsMux *mux);
|
||||
void tsmux_resend_pat (TsMux *mux);
|
||||
guint16 tsmux_get_new_pid (TsMux *mux);
|
||||
|
||||
/* pid/program management */
|
||||
|
@ -196,10 +197,12 @@ TsMuxProgram * tsmux_program_new (TsMux *mux, gint prog_id);
|
|||
void tsmux_program_free (TsMuxProgram *program);
|
||||
void tsmux_set_pmt_interval (TsMuxProgram *program, guint interval);
|
||||
guint tsmux_get_pmt_interval (TsMuxProgram *program);
|
||||
void tsmux_resend_pmt (TsMuxProgram *program);
|
||||
|
||||
/* SI table management */
|
||||
void tsmux_set_si_interval (TsMux *mux, guint interval);
|
||||
guint tsmux_get_si_interval (TsMux *mux);
|
||||
void tsmux_resend_si (TsMux *mux);
|
||||
gboolean tsmux_add_mpegts_si_section (TsMux * mux, GstMpegtsSection * section);
|
||||
|
||||
/* stream management */
|
||||
|
|
Loading…
Reference in a new issue