diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2019-02-27 18:47:09 +0100 |
---|---|---|
committer | Mathieu Duponchelle <mathieu@centricular.com> | 2019-02-27 19:00:36 +0100 |
commit | 91c76b085173b06974e3b7caa4a604dfee1abcb7 (patch) | |
tree | 0d7a836f6c97fe3baeb7bdf39d392a15c1e471cd | |
parent | a751b33072055e069d1adba3ac9eb881d804d759 (diff) |
mpegtsmux: restore stream creation order
In 7c767f3fcd5a7b40d205bb4d588dad6c6275c729 , stream creation was
refactored to occur before potential program creation. This created
issues with pipelines such as:
gst-launch-1.0 videotestsrc ! video/x-raw, format=I420, width=640, height=640, framerate=25/1 ! \
x264enc ! hlssink2 target-duration=1
eg.: gst_buffer_copy_into: assertion 'bufsize >= offset + size' failed
As this reordering was actually not needed for the purpose of allowing
to specify a PCR stream, this reverts the reordering part of the
initial commit.
-rw-r--r-- | gst/mpegtsmux/mpegtsmux.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c index a21316132..58b1009bf 100644 --- a/gst/mpegtsmux/mpegtsmux.c +++ b/gst/mpegtsmux/mpegtsmux.c @@ -878,6 +878,7 @@ mpegtsmux_create_stream (MpegTsMux * mux, MpegTsPadData * ts_data) ts_data->stream->opus_channel_config_code = opus_channel_config_code; tsmux_stream_set_buffer_release_func (ts_data->stream, release_buffer_cb); + tsmux_program_add_stream (ts_data->prog, ts_data->stream); ret = GST_FLOW_OK; } @@ -956,12 +957,6 @@ mpegtsmux_create_streams (MpegTsMux * mux) } } - if (ts_data->stream == NULL) { - ret = mpegtsmux_create_stream (mux, ts_data); - if (ret != GST_FLOW_OK) - goto no_stream; - } - ts_data->prog = g_hash_table_lookup (mux->programs, GINT_TO_POINTER (ts_data->prog_id)); if (ts_data->prog == NULL) { @@ -980,7 +975,11 @@ mpegtsmux_create_streams (MpegTsMux * mux) tsmux_program_set_pcr_stream (ts_data->prog, ts_data->stream); } - tsmux_program_add_stream (ts_data->prog, ts_data->stream); + if (ts_data->stream == NULL) { + ret = mpegtsmux_create_stream (mux, ts_data); + if (ret != GST_FLOW_OK) + goto no_stream; + } /* Check for user-specified PCR PID */ pcr_name = g_strdup_printf ("PCR_%d", ts_data->prog->pgm_number); |