mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-09 00:45:56 +00:00
mxf: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
This commit is contained in:
parent
8f252b1e99
commit
71890cc2f1
5 changed files with 287 additions and 431 deletions
|
@ -375,136 +375,124 @@ mxf_metadata_wave_audio_essence_descriptor_write_tags (MXFMetadataBase * m,
|
|||
0x04, 0x02, 0x03, 0x01, 0x0E, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &block_align_ul, 16);
|
||||
t->size = 2;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT16_BE (t->data, self->block_align);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d0a, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
|
||||
if (self->sequence_offset) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &sequence_offset_ul, 16);
|
||||
t->size = 1;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT8 (t->data, self->sequence_offset);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d0b, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &avg_bps_ul, 16);
|
||||
t->size = 4;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT32_BE (t->data, self->avg_bps);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d09, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
|
||||
if (!mxf_ul_is_zero (&self->channel_assignment)) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &channel_assignment_ul, 16);
|
||||
t->size = 16;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
memcpy (t->data, &self->channel_assignment, 16);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d32, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->peak_envelope_version) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &peak_envelope_version_ul, 16);
|
||||
t->size = 4;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT32_BE (t->data, self->peak_envelope_version);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d29, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->peak_envelope_format) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &peak_envelope_format_ul, 16);
|
||||
t->size = 4;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT32_BE (t->data, self->peak_envelope_format);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d2a, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->points_per_peak_value) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &points_per_peak_value_ul, 16);
|
||||
t->size = 4;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT32_BE (t->data, self->points_per_peak_value);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d2b, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->peak_envelope_block_size) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &peak_envelope_block_size_ul, 16);
|
||||
t->size = 4;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT32_BE (t->data, self->peak_envelope_block_size);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d2c, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->peak_channels) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &peak_channels_ul, 16);
|
||||
t->size = 4;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT32_BE (t->data, self->peak_channels);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d2d, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->peak_frames) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &peak_frames_ul, 16);
|
||||
t->size = 4;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT32_BE (t->data, self->peak_frames);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d2e, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->peak_of_peaks_position) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &peak_of_peaks_position_ul, 16);
|
||||
t->size = 8;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT64_BE (t->data, self->peak_of_peaks_position);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d2f, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (!mxf_timestamp_is_unknown (&self->peak_envelope_timestamp)) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &peak_envelope_timestamp_ul, 16);
|
||||
t->size = 8;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
mxf_timestamp_write (&self->peak_envelope_timestamp, t->data);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d30, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->peak_envelope_data) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &peak_envelope_data_ul, 16);
|
||||
t->size = self->peak_envelope_data_length;
|
||||
t->data = g_memdup2 (self->peak_envelope_data, t->size);
|
||||
|
@ -976,44 +964,40 @@ mxf_metadata_aes3_audio_essence_descriptor_write_tags (MXFMetadataBase * m,
|
|||
};
|
||||
|
||||
if (self->emphasis) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &emphasis_ul, 16);
|
||||
t->size = 1;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT8 (t->data, self->emphasis);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d0d, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->block_start_offset) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &block_start_offset_ul, 16);
|
||||
t->size = 2;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT16_BE (t->data, self->block_start_offset);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d0f, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->auxiliary_bits_mode) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &auxiliary_bits_mode_ul, 16);
|
||||
t->size = 1;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT8 (t->data, self->auxiliary_bits_mode);
|
||||
mxf_primer_pack_add_mapping (primer, 0x3d08, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->channel_status_mode) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &channel_status_mode_ul, 16);
|
||||
t->size = 8 + self->n_channel_status_mode;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT32_BE (t->data, self->n_channel_status_mode);
|
||||
GST_WRITE_UINT32_BE (t->data + 4, 1);
|
||||
memcpy (t->data + 8, self->channel_status_mode, t->size);
|
||||
|
@ -1024,11 +1008,10 @@ mxf_metadata_aes3_audio_essence_descriptor_write_tags (MXFMetadataBase * m,
|
|||
if (self->fixed_channel_status_data) {
|
||||
guint i;
|
||||
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &fixed_channel_status_data_ul, 16);
|
||||
t->size = 8 + 24 * self->n_fixed_channel_status_data;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT32_BE (t->data, self->n_fixed_channel_status_data);
|
||||
GST_WRITE_UINT32_BE (t->data + 4, 24);
|
||||
for (i = 0; i < self->n_fixed_channel_status_data; i++)
|
||||
|
@ -1038,11 +1021,10 @@ mxf_metadata_aes3_audio_essence_descriptor_write_tags (MXFMetadataBase * m,
|
|||
}
|
||||
|
||||
if (self->user_data_mode) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &user_data_mode_ul, 16);
|
||||
t->size = 8 + self->n_user_data_mode;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT32_BE (t->data, self->n_user_data_mode);
|
||||
GST_WRITE_UINT32_BE (t->data + 4, 1);
|
||||
memcpy (t->data + 8, self->user_data_mode, t->size);
|
||||
|
@ -1053,11 +1035,10 @@ mxf_metadata_aes3_audio_essence_descriptor_write_tags (MXFMetadataBase * m,
|
|||
if (self->fixed_user_data) {
|
||||
guint i;
|
||||
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &fixed_user_data_ul, 16);
|
||||
t->size = 8 + 24 * self->n_fixed_user_data;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT32_BE (t->data, self->n_fixed_user_data);
|
||||
GST_WRITE_UINT32_BE (t->data + 4, 24);
|
||||
for (i = 0; i < self->n_fixed_user_data; i++)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -258,110 +258,100 @@ mxf_metadata_mpeg_video_descriptor_write_tags (MXFMetadataBase * m,
|
|||
MXFLocalTag *t;
|
||||
|
||||
if (self->single_sequence != -1) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &_single_sequence_ul, 16);
|
||||
t->size = 1;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT8 (t->data, (self->single_sequence) ? 1 : 0);
|
||||
mxf_primer_pack_add_mapping (primer, 0, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->const_b_frames) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &_constant_b_frames_ul, 16);
|
||||
t->size = 1;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT8 (t->data, (self->const_b_frames) ? 1 : 0);
|
||||
mxf_primer_pack_add_mapping (primer, 0, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->coded_content_type) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &_coded_content_type_ul, 16);
|
||||
t->size = 1;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT8 (t->data, self->coded_content_type);
|
||||
mxf_primer_pack_add_mapping (primer, 0, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->low_delay) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &_low_delay_ul, 16);
|
||||
t->size = 1;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT8 (t->data, (self->low_delay) ? 1 : 0);
|
||||
mxf_primer_pack_add_mapping (primer, 0, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->closed_gop) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &_closed_gop_ul, 16);
|
||||
t->size = 1;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT8 (t->data, (self->closed_gop) ? 1 : 0);
|
||||
mxf_primer_pack_add_mapping (primer, 0, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->identical_gop) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &_identical_gop_ul, 16);
|
||||
t->size = 1;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT8 (t->data, (self->identical_gop) ? 1 : 0);
|
||||
mxf_primer_pack_add_mapping (primer, 0, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->max_gop) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &_identical_gop_ul, 16);
|
||||
t->size = 2;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT16_BE (t->data, self->max_gop);
|
||||
mxf_primer_pack_add_mapping (primer, 0, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->b_picture_count) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &_b_picture_count_ul, 16);
|
||||
t->size = 2;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT16_BE (t->data, self->b_picture_count);
|
||||
mxf_primer_pack_add_mapping (primer, 0, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->bitrate) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &_bitrate_ul, 16);
|
||||
t->size = 4;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT32_BE (t->data, self->bitrate);
|
||||
mxf_primer_pack_add_mapping (primer, 0, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
}
|
||||
|
||||
if (self->profile_and_level) {
|
||||
t = g_slice_new0 (MXFLocalTag);
|
||||
t = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&t->ul, &_profile_and_level_ul, 16);
|
||||
t->size = 1;
|
||||
t->data = g_slice_alloc (t->size);
|
||||
t->g_slice = TRUE;
|
||||
t->data = g_malloc (t->size);
|
||||
GST_WRITE_UINT8 (t->data, self->profile_and_level);
|
||||
mxf_primer_pack_add_mapping (primer, 0, &t->ul);
|
||||
ret = g_list_prepend (ret, t);
|
||||
|
@ -1315,7 +1305,7 @@ mxf_mpeg_video_get_descriptor (GstPadTemplate * tmpl, GstCaps * caps,
|
|||
ret->parent.parent.parent.essence_container.u[13] = 0x04;
|
||||
ret->parent.parent.parent.essence_container.u[14] = 0x60;
|
||||
if ((v = gst_structure_get_value (s, "codec_data"))) {
|
||||
MXFLocalTag *t = g_slice_new0 (MXFLocalTag);
|
||||
MXFLocalTag *t = g_new0 (MXFLocalTag, 1);
|
||||
GstMapInfo map;
|
||||
|
||||
codec_data = gst_value_get_buffer (v);
|
||||
|
|
|
@ -1452,7 +1452,7 @@ mxf_index_table_segment_to_buffer (const MXFIndexTableSegment * segment)
|
|||
static void
|
||||
_mxf_mapping_ul_free (MXFUL * ul)
|
||||
{
|
||||
g_slice_free (MXFUL, ul);
|
||||
g_free (ul);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -1502,7 +1502,7 @@ mxf_primer_pack_parse (const MXFUL * ul, MXFPrimerPack * pack,
|
|||
if (g_hash_table_lookup (pack->mappings, GUINT_TO_POINTER (local_tag)))
|
||||
continue;
|
||||
|
||||
uid = g_slice_new (MXFUL);
|
||||
uid = g_new (MXFUL, 1);
|
||||
memcpy (uid, data, 16);
|
||||
data += 16;
|
||||
|
||||
|
@ -1575,13 +1575,13 @@ mxf_primer_pack_add_mapping (MXFPrimerPack * primer, guint16 local_tag,
|
|||
|
||||
g_assert (ltag_tmp != 0);
|
||||
|
||||
uid = g_slice_new (MXFUL);
|
||||
uid = g_new (MXFUL, 1);
|
||||
memcpy (uid, ul, 16);
|
||||
|
||||
GST_DEBUG ("Adding mapping = 0x%04x -> %s", ltag_tmp,
|
||||
mxf_ul_to_string (uid, str));
|
||||
g_hash_table_insert (primer->mappings, GUINT_TO_POINTER (ltag_tmp), uid);
|
||||
uid = g_slice_dup (MXFUL, uid);
|
||||
uid = g_memdup2 (uid, sizeof (MXFUL));
|
||||
g_hash_table_insert (primer->reverse_mappings, uid,
|
||||
GUINT_TO_POINTER (ltag_tmp));
|
||||
|
||||
|
@ -1664,11 +1664,8 @@ mxf_local_tag_parse (const guint8 * data, guint size, guint16 * tag,
|
|||
void
|
||||
mxf_local_tag_free (MXFLocalTag * tag)
|
||||
{
|
||||
if (tag->g_slice)
|
||||
g_slice_free1 (tag->size, tag->data);
|
||||
else
|
||||
g_free (tag->data);
|
||||
g_slice_free (MXFLocalTag, tag);
|
||||
g_free (tag->data);
|
||||
g_free (tag);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -1703,11 +1700,10 @@ mxf_local_tag_add_to_hash_table (const MXFPrimerPack * primer,
|
|||
GST_DEBUG ("Adding local tag 0x%04x with UL %s and size %u", tag,
|
||||
mxf_ul_to_string (ul, str), tag_size);
|
||||
|
||||
local_tag = g_slice_new0 (MXFLocalTag);
|
||||
local_tag = g_new0 (MXFLocalTag, 1);
|
||||
memcpy (&local_tag->ul, ul, sizeof (MXFUL));
|
||||
local_tag->size = tag_size;
|
||||
local_tag->data = tag_size == 0 ? NULL : g_memdup2 (tag_data, tag_size);
|
||||
local_tag->g_slice = FALSE;
|
||||
|
||||
g_hash_table_insert (*hash_table, &local_tag->ul, local_tag);
|
||||
} else {
|
||||
|
|
|
@ -66,8 +66,6 @@ typedef struct {
|
|||
MXFUL ul;
|
||||
guint16 size;
|
||||
guint8 *data;
|
||||
|
||||
gboolean g_slice; /* TRUE if data was allocated by GSlice */
|
||||
} MXFLocalTag;
|
||||
|
||||
/* SMPTE 377M 11.1 */
|
||||
|
|
Loading…
Reference in a new issue