Skip to content

tsmux: More cleanups

Jan Alexander Steffens requested to merge heftig/gstreamer:tsmux-more-fixes into main
  • 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 passing NULLs to ignore the payload information, but assert that the payload length is zero in this case.

  • tsmux: Don't memset in pad_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 for g_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.
  • tsmux: Add missing include
    We need GstMpegtsPMTStream here.

  • tsmux: Fix default new_stream_func
    tsmux_stream_new is missing the user_data parameter and shouldn't be cast to TsMuxNewStreamFunc.

    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 the user_data parameter and shouldn't be cast to TsMuxStreamGetESDescriptorsFunc.

    Prefer not casting at all to make sure we don't miss such an issue.

Edited by Jan Alexander Steffens

Merge request reports