mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 00:01:23 +00:00
mpegtsparse: unref caps on dispose, reset packet size on _reset
This commit is contained in:
parent
ec100c87c7
commit
309eaafb04
1 changed files with 13 additions and 0 deletions
|
@ -176,6 +176,11 @@ mpegts_packetizer_dispose (GObject * object)
|
|||
MpegTSPacketizer *packetizer = GST_MPEGTS_PACKETIZER (object);
|
||||
|
||||
if (!packetizer->disposed) {
|
||||
if (packetizer->know_packet_size && packetizer->caps != NULL) {
|
||||
gst_caps_unref (packetizer->caps);
|
||||
packetizer->caps = NULL;
|
||||
packetizer->know_packet_size = FALSE;
|
||||
}
|
||||
gst_adapter_clear (packetizer->adapter);
|
||||
g_object_unref (packetizer->adapter);
|
||||
packetizer->disposed = TRUE;
|
||||
|
@ -1931,6 +1936,14 @@ remove_all (gpointer key, gpointer value, gpointer user_data)
|
|||
void
|
||||
mpegts_packetizer_clear (MpegTSPacketizer * packetizer)
|
||||
{
|
||||
if (packetizer->know_packet_size) {
|
||||
packetizer->know_packet_size = FALSE;
|
||||
packetizer->packet_size = 0;
|
||||
if (packetizer->caps != NULL) {
|
||||
gst_caps_unref (packetizer->caps);
|
||||
packetizer->caps = NULL;
|
||||
}
|
||||
}
|
||||
/* FIXME can't use remove_all because we don't depend on 2.12 yet */
|
||||
g_hash_table_foreach_remove (packetizer->streams, remove_all, NULL);
|
||||
gst_adapter_clear (packetizer->adapter);
|
||||
|
|
Loading…
Reference in a new issue