[PATCH 2/5] winegstreamer: Push stream-start and segment events in push mode.
Derek Lesho
dlesho at codeweavers.com
Thu Mar 11 14:36:46 CST 2021
On 3/11/21 3:27 PM, Zebediah Figura (she/her) wrote:
> On 3/10/21 1:33 PM, Derek Lesho wrote:
>> Signed-off-by: Derek Lesho <dlesho at codeweavers.com>
>> ---
>> dlls/winegstreamer/wg_parser.c | 13 +++++++++++++
>> 1 file changed, 13 insertions(+)
>>
>> diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
>> index 67f65264a8d..0dc0d30f64c 100644
>> --- a/dlls/winegstreamer/wg_parser.c
>> +++ b/dlls/winegstreamer/wg_parser.c
>> @@ -1252,6 +1252,7 @@ static void *push_data(void *arg)
>> {
>> struct wg_parser *parser = arg;
>> GstBuffer *buffer;
>> + GstSegment *segment;
>> guint max_size;
>>
>> GST_DEBUG("Starting push thread.");
>> @@ -1264,6 +1265,12 @@ static void *push_data(void *arg)
>>
>> max_size = parser->stop_offset ? parser->stop_offset : parser->file_size;
>>
>> + gst_pad_push_event(parser->my_src, gst_event_new_stream_start("wg_stream"));
>> +
>> + segment = gst_segment_new();
>> + gst_segment_init(segment, GST_FORMAT_BYTES);
>> + gst_pad_push_event(parser->my_src, gst_event_new_segment(segment));
>> +
> This (and the below) leaks "segment". You probably want to allocate it
> on stack instead (despite the naming, it's not a proper object).
👌
>
> Should we initialize the segment stop time (i.e. file size)?
Yeah, that wouldn't hurt.
>
>> for (;;)
>> {
>> ULONG size;
>> @@ -1398,6 +1405,7 @@ static gboolean src_perform_seek(struct wg_parser *parser, GstEvent *event)
>> GstEvent *flush_event;
>> GstSeekFlags flags;
>> gint64 cur, stop;
>> + GstSegment *seg;
>> guint32 seqnum;
>> gdouble rate;
>>
>> @@ -1431,7 +1439,12 @@ static gboolean src_perform_seek(struct wg_parser *parser, GstEvent *event)
>> gst_event_set_seqnum(flush_event, seqnum);
>> gst_pad_push_event(parser->my_src, flush_event);
>> if (thread)
>> + {
>> gst_pad_set_active(parser->my_src, 1);
>> + seg = gst_segment_new();
>> + gst_segment_init(seg, GST_FORMAT_BYTES);
>> + gst_pad_push_event(parser->my_src, gst_event_new_segment(seg));
>> + }
>> }
>>
>> return TRUE;
>>
>
More information about the wine-devel
mailing list