tsmux: Fix two more uses of gst_buffer_map

The buffers should be used for writing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5516>
This commit is contained in:
Jan Alexander Steffens (heftig) 2023-10-16 23:50:16 +02:00 committed by GStreamer Marge Bot
parent 7c49ce1c21
commit a65035ac25

View file

@ -871,7 +871,7 @@ tsmux_packet_out (TsMux * mux, GstBuffer * buf, gint64 pcr)
goto error; goto error;
} }
gst_buffer_map (buf, &map, GST_MAP_READ); gst_buffer_map (buf, &map, GST_MAP_WRITE);
tsmux_write_ts_header (mux, map.data, &stream->pi, &payload_len, tsmux_write_ts_header (mux, map.data, &stream->pi, &payload_len,
&payload_offs, 0); &payload_offs, 0);
gst_buffer_unmap (buf, &map); gst_buffer_unmap (buf, &map);
@ -1637,7 +1637,7 @@ tsmux_write_stream_packet (TsMux * mux, TsMuxStream * stream)
if (!tsmux_get_buffer (mux, &buf)) if (!tsmux_get_buffer (mux, &buf))
return FALSE; return FALSE;
gst_buffer_map (buf, &map, GST_MAP_READ); gst_buffer_map (buf, &map, GST_MAP_WRITE);
if (!tsmux_write_ts_header (mux, map.data, pi, &payload_len, &payload_offs, if (!tsmux_write_ts_header (mux, map.data, pi, &payload_len, &payload_offs,
pi->stream_avail)) pi->stream_avail))