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.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5496>
This commit is contained in:
Jan Alexander Steffens (heftig) 2023-10-10 10:39:55 +02:00 committed by GStreamer Marge Bot
parent 2d72008361
commit 6053dd0d1b
3 changed files with 10 additions and 5 deletions

View file

@ -306,8 +306,7 @@ gst_atsc_mux_create_new_stream (guint16 new_pid, TsMuxStreamType stream_type,
}
tsmux_stream_set_get_es_descriptors_func (ret,
(TsMuxStreamGetESDescriptorsFunc) gst_atsc_mux_stream_get_es_descrs,
user_data);
gst_atsc_mux_stream_get_es_descrs, user_data);
return ret;
}

View file

@ -96,6 +96,13 @@ struct TsMuxStreamBuffer
void *user_data;
};
static void
tsmux_stream_get_es_descrs_default (TsMuxStream * stream,
GstMpegtsPMTStream * pmt_stream, gpointer user_data)
{
tsmux_stream_default_get_es_descrs (stream, pmt_stream);
}
/**
* tsmux_stream_new:
* @pid: a PID
@ -238,8 +245,7 @@ tsmux_stream_new (guint16 pid, guint stream_type, guint stream_number)
stream->pcr_ref = 0;
stream->next_pcr = -1;
stream->get_es_descrs =
(TsMuxStreamGetESDescriptorsFunc) tsmux_stream_default_get_es_descrs;
stream->get_es_descrs = tsmux_stream_get_es_descrs_default;
stream->get_es_descrs_data = NULL;
return stream;

View file

@ -76,7 +76,7 @@ typedef enum TsMuxStreamState TsMuxStreamState;
typedef struct TsMuxStreamBuffer TsMuxStreamBuffer;
typedef void (*TsMuxStreamBufferReleaseFunc) (guint8 *data, void *user_data);
typedef void (*TsMuxStreamGetESDescriptorsFunc) (TsMuxStream *stream, GstMpegtsPMTStream *pmt_stream, void *user_data);
typedef void (*TsMuxStreamGetESDescriptorsFunc) (TsMuxStream *stream, GstMpegtsPMTStream *pmt_stream, gpointer user_data);
/* Stream type assignments
*