}
case GST_EVENT_SEGMENT:
{
- GstAudioMixerPad *pad = GST_AUDIO_MIXER_PAD (aggpad);
const GstSegment *segment;
gst_event_parse_segment (event, &segment);
gst_event_unref (event);
event = NULL;
} else {
+ GstAudioMixerPad *pad = GST_AUDIO_MIXER_PAD (aggpad);
+
/* Ideally, this should only be set when the new segment causes running
* times to change, and hence needs discont calculation in fill_buffer */
+ GST_OBJECT_LOCK (pad);
pad->new_segment = TRUE;
+ GST_OBJECT_UNLOCK (pad);
}
break;
}
rate = GST_AUDIO_INFO_RATE (&audiomixer->info);
bpf = GST_AUDIO_INFO_BPF (&audiomixer->info);
- timestamp = GST_BUFFER_TIMESTAMP (inbuf);
+ timestamp = GST_BUFFER_PTS (inbuf);
stream_time = gst_segment_to_stream_time (&aggpad->segment, GST_FORMAT_TIME,
timestamp);
if (GST_CLOCK_TIME_IS_VALID (stream_time))
gst_object_sync_values (GST_OBJECT (pad), stream_time);
+ GST_OBJECT_LOCK (pad);
pad->position = 0;
pad->size = gst_buffer_get_size (inbuf);
GST_DEBUG_OBJECT (pad,
"Buffer before segment or current position: %" G_GUINT64_FORMAT " < %"
G_GUINT64_FORMAT, end_running_time_offset, audiomixer->offset);
+ GST_OBJECT_UNLOCK (pad);
return FALSE;
}
"Buffer before segment or current position: %" G_GUINT64_FORMAT
" < %" G_GUINT64_FORMAT, end_running_time_offset,
audiomixer->offset);
+ GST_OBJECT_UNLOCK (pad);
return FALSE;
}
}
"Queued new buffer at offset %" G_GUINT64_FORMAT, pad->output_offset);
pad->buffer = inbuf;
+ GST_OBJECT_UNLOCK (pad);
return TRUE;
}
bpf = GST_AUDIO_INFO_BPF (&audiomixer->info);
+ GST_OBJECT_LOCK (pad);
/* Overlap => mix */
if (audiomixer->offset < pad->output_offset)
out_start = pad->output_offset - audiomixer->offset;
overlap = blocksize - out_start;
inbuf = gst_aggregator_pad_get_buffer (aggpad);
- if (inbuf == NULL)
+ if (inbuf == NULL) {
+ GST_OBJECT_UNLOCK (pad);
return;
+ }
- GST_OBJECT_LOCK (pad);
if (pad->mute || pad->volume < G_MINDOUBLE) {
GST_DEBUG_OBJECT (pad, "Skipping muted pad");
gst_buffer_unref (inbuf);