Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/upipe-modules/uref_aes_flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ static inline int uref_aes_delete(struct uref *uref)

static inline int uref_aes_copy(struct uref *uref, struct uref *uref_src)
{
int (*list[])(struct uref *, struct uref *) = {
int (*attrs[])(struct uref *, struct uref *) = {
uref_aes_copy_method,
uref_aes_copy_key,
uref_aes_copy_iv,
};
return uref_attr_copy_list(uref, uref_src, list, UBASE_ARRAY_SIZE(list));
return uref_attr_copy_array(uref, uref_src, attrs);
}

#ifdef __cplusplus
Expand Down
4 changes: 4 additions & 0 deletions include/upipe/uref_attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ static inline int uref_attr_copy_list(struct uref *uref, struct uref *uref_src,
return err;
}

/** @This is an helper to copy an array of attributes from an uref to another */
#define uref_attr_copy_array(uref_dst, uref_src, array) \
uref_attr_copy_list(uref_dst, uref_src, array, UBASE_ARRAY_SIZE(array))

/** @This deletes an attribute.
*
* @param uref pointer to the uref
Expand Down
4 changes: 2 additions & 2 deletions include/upipe/uref_m3u_master.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static inline int uref_m3u_master_delete(struct uref *uref)
static inline int uref_m3u_master_copy(struct uref *uref,
struct uref *uref_src)
{
int (*list[])(struct uref *, struct uref *) = {
int (*attrs[])(struct uref *, struct uref *) = {
uref_m3u_master_copy_bandwidth,
uref_m3u_master_copy_codecs,
uref_m3u_master_copy_resolution,
Expand All @@ -62,7 +62,7 @@ static inline int uref_m3u_master_copy(struct uref *uref,
uref_m3u_master_copy_media_name,
uref_m3u_master_copy_media_group,
};
return uref_attr_copy_list(uref, uref_src, list, UBASE_ARRAY_SIZE(list));
return uref_attr_copy_array(uref, uref_src, attrs);
}

static inline int uref_m3u_master_iterate_codecs(struct uref *uref,
Expand Down
16 changes: 8 additions & 8 deletions include/upipe/uref_m3u_playlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,27 +111,27 @@ static inline int uref_m3u_playlist_delete(struct uref *uref)
static inline int uref_m3u_playlist_key_copy(struct uref *uref,
struct uref *uref_src)
{
int (*list[])(struct uref *, struct uref *) = {
int (*attrs[])(struct uref *, struct uref *) = {
uref_m3u_playlist_key_copy_method,
uref_m3u_playlist_key_copy_uri,
uref_m3u_playlist_key_copy_iv,
};
return uref_attr_copy_list(uref, uref_src, list, UBASE_ARRAY_SIZE(list));
return uref_attr_copy_array(uref, uref_src, attrs);
}

static inline int uref_m3u_playlist_map_copy(struct uref *uref,
struct uref *uref_src)
{
int (*list[])(struct uref *, struct uref *) = {
int (*attrs[])(struct uref *, struct uref *) = {
uref_m3u_playlist_map_copy_uri,
};
return uref_attr_copy_list(uref, uref_src, list, UBASE_ARRAY_SIZE(list));
return uref_attr_copy_array(uref, uref_src, attrs);
}

static inline int uref_m3u_playlist_daterange_copy(struct uref *uref,
struct uref *uref_src)
{
int (*list[])(struct uref *, struct uref *) = {
int (*attrs[])(struct uref *, struct uref *) = {
uref_m3u_playlist_daterange_copy_id,
uref_m3u_playlist_daterange_copy_start_date,
uref_m3u_playlist_daterange_copy_end_date,
Expand All @@ -141,13 +141,13 @@ static inline int uref_m3u_playlist_daterange_copy(struct uref *uref,
uref_m3u_playlist_daterange_copy_scte35_out,
uref_m3u_playlist_daterange_copy_scte35_in,
};
return uref_attr_copy_list(uref, uref_src, list, UBASE_ARRAY_SIZE(list));
return uref_attr_copy_array(uref, uref_src, attrs);
}

static inline int uref_m3u_playlist_copy(struct uref *uref,
struct uref *uref_src)
{
int (*list[])(struct uref *, struct uref *) = {
int (*attrs[])(struct uref *, struct uref *) = {
uref_m3u_playlist_copy_seq_duration,
uref_m3u_playlist_copy_byte_range_len,
uref_m3u_playlist_copy_byte_range_off,
Expand All @@ -158,7 +158,7 @@ static inline int uref_m3u_playlist_copy(struct uref *uref,
uref_m3u_playlist_map_copy,
uref_m3u_playlist_daterange_copy,
};
return uref_attr_copy_list(uref, uref_src, list, UBASE_ARRAY_SIZE(list));
return uref_attr_copy_array(uref, uref_src, attrs);
}

#ifdef __cplusplus
Expand Down
4 changes: 2 additions & 2 deletions include/upipe/uref_m3u_playlist_flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ static inline int uref_m3u_playlist_flow_delete(struct uref *uref)
static inline int uref_m3u_playlist_flow_copy(struct uref *uref,
struct uref *uref_src)
{
int (*list[])(struct uref *, struct uref *) = {
int (*attrs[])(struct uref *, struct uref *) = {
uref_m3u_playlist_flow_copy_type,
uref_m3u_playlist_flow_copy_target_duration,
uref_m3u_playlist_flow_copy_media_sequence,
uref_m3u_playlist_flow_copy_discontinuity_sequence,
uref_m3u_playlist_flow_copy_endlist,
};

return uref_attr_copy_list(uref, uref_src, list, UBASE_ARRAY_SIZE(list));
return uref_attr_copy_array(uref, uref_src, attrs);
}

#ifdef __cplusplus
Expand Down
4 changes: 2 additions & 2 deletions include/upipe/uref_uri.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static inline int uref_uri_delete(struct uref *uref)

static inline int uref_uri_copy(struct uref *uref, struct uref *from)
{
int (*list[])(struct uref *, struct uref *) = {
int (*attrs[])(struct uref *, struct uref *) = {
uref_uri_copy_scheme,
uref_uri_copy_userinfo,
uref_uri_copy_host,
Expand All @@ -53,7 +53,7 @@ static inline int uref_uri_copy(struct uref *uref, struct uref *from)
uref_uri_copy_query,
uref_uri_copy_fragment,
};
return uref_attr_copy_list(uref, from, list, UBASE_ARRAY_SIZE(list));
return uref_attr_copy_array(uref, from, attrs);
}

#ifdef __cplusplus
Expand Down
Loading