fix flacdec when src not connected

Original commit message from CVS:
fix flacdec when src not connected
This commit is contained in:
Thomas Vander Stichele 2003-06-28 14:24:04 +00:00
parent 055ee4d5cc
commit 7519af569b

View file

@ -428,29 +428,28 @@ gst_flacdec_write (const FLAC__SeekableStreamDecoder *decoder,
GstEvent *discont;
flacdec->need_discont = FALSE;
if (!GST_PAD_CAPS (flacdec->srcpad)) {
if (flacdec->seek_pending) {
flacdec->total_samples = flacdec->seek_value;
}
if (flacdec->seek_pending) {
flacdec->total_samples = flacdec->seek_value;
}
if (GST_PAD_IS_USABLE (flacdec->srcpad)) {
GST_DEBUG (0, "send discont");
if (GST_PAD_IS_USABLE (flacdec->srcpad)) {
GST_DEBUG (0, "send discont");
format = GST_FORMAT_TIME;
gst_pad_convert (flacdec->srcpad, GST_FORMAT_DEFAULT,
flacdec->total_samples, &format, &time);
format = GST_FORMAT_BYTES;
gst_pad_convert (flacdec->srcpad, GST_FORMAT_DEFAULT,
flacdec->total_samples, &format, &bytes);
discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME, time,
GST_FORMAT_BYTES, bytes,
format = GST_FORMAT_TIME;
gst_pad_convert (flacdec->srcpad, GST_FORMAT_DEFAULT,
flacdec->total_samples, &format, &time);
format = GST_FORMAT_BYTES;
gst_pad_convert (flacdec->srcpad, GST_FORMAT_DEFAULT,
flacdec->total_samples, &format, &bytes);
discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME, time,
GST_FORMAT_BYTES, bytes,
GST_FORMAT_DEFAULT, flacdec->total_samples,
NULL);
gst_pad_push (flacdec->srcpad, GST_BUFFER (discont));
gst_pad_push (flacdec->srcpad, GST_BUFFER (discont));
}
}
}
@ -771,4 +770,3 @@ gst_flacdec_get_property (GObject *object, guint prop_id,
g_warning ("Unknown property id\n");
}
}