dv_decode_full_audio (dvdemux->decoder, data, dvdemux->audio_buffers);
- if ((num_samples = dv_get_num_samples (dvdemux->decoder)) > 0) {
+ if (G_LIKELY ((num_samples = dv_get_num_samples (dvdemux->decoder)) > 0)) {
gint16 *a_ptr;
gint i, j;
GstBuffer *outbuf;
gint frequency, channels;
- if (dvdemux->audiosrcpad == NULL)
+ if (G_UNLIKELY (dvdemux->audiosrcpad == NULL))
dvdemux->audiosrcpad = gst_dvdemux_add_pad (dvdemux, &audio_src_temp);
/* get initial format or check if format changed */
frequency = dv_get_frequency (dvdemux->decoder);
channels = dv_get_num_channels (dvdemux->decoder);
- if ((frequency != dvdemux->frequency) || (channels != dvdemux->channels)) {
+ if (G_UNLIKELY ((frequency != dvdemux->frequency)
+ || (channels != dvdemux->channels))) {
GstCaps *caps;
dvdemux->frequency = frequency;
dvdemux->audio_offset += num_samples;
GST_BUFFER_OFFSET_END (outbuf) = dvdemux->audio_offset;
+ if (dvdemux->new_media)
+ GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (dvdemux->audiosrcpad));
ret = gst_pad_push (dvdemux->audiosrcpad, outbuf);
gboolean wide;
GstFlowReturn ret = GST_FLOW_OK;
- if (dvdemux->videosrcpad == NULL)
+ if (G_UNLIKELY (dvdemux->videosrcpad == NULL))
dvdemux->videosrcpad = gst_dvdemux_add_pad (dvdemux, &video_src_temp);
/* get params */
GST_BUFFER_OFFSET_END (outbuf) = dvdemux->video_offset + 1;
GST_BUFFER_DURATION (outbuf) = duration;
+ if (dvdemux->new_media)
+ GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (dvdemux->videosrcpad));
GST_DEBUG ("pushing video %" GST_TIME_FORMAT,
data = GST_BUFFER_DATA (buffer);
dv_parse_packs (dvdemux->decoder, data);
- if (G_UNLIKELY (dv_is_new_recording (dvdemux->decoder, data)))
- dvdemux->new_media = TRUE;
+ dvdemux->new_media = dv_is_new_recording (dvdemux->decoder, data);
/* does not take ownership of buffer */
aret = ret = gst_dvdemux_demux_audio (dvdemux, buffer, duration);