tsmux: More cleanups
-
tsmux: Fix two more uses of
gst_buffer_map
The buffers should be used for writing. -
tsmux: Move out parameters of
tsmux_write_ts_header
Move them to the end of the parameter list and also allow passingNULL
s to ignore the payload information, but assert that the payload length is zero in this case. -
tsmux: Don't
memset
inpad_stream
when writing a PCR packet
tsmux_write_ts_header
will write a stuffing adaptation field, so we don't need to prefill the buffer. -
tsmux:
tsmux_packet_out
should always consume its buffer
Consuming the buffer only when successful is an antipattern and easily leads to leaks. -
tsmux: Simplify
tsmux_section_write_packet
- Don't try to make the parameters match
GHFunc
. Use a dedicated callback forg_hash_table_foreach
. - Don't try to be clever with buffer memories. We're allocating a full
packet anyway, might as well
memcpy
and save on a lot of complexity.
- Don't try to make the parameters match
-
tsmux: Add missing include
We needGstMpegtsPMTStream
here. -
tsmux: Fix default
new_stream_func
tsmux_stream_new
is missing theuser_data
parameter and shouldn't be cast toTsMuxNewStreamFunc
.Prefer not casting at all to make sure we don't miss such an issue.
-
tsmux: Fix default
get_es_descrs_func
tsmux_stream_default_get_es_descrs
is missing theuser_data
parameter and shouldn't be cast toTsMuxStreamGetESDescriptorsFunc
.Prefer not casting at all to make sure we don't miss such an issue.