resindvd: Change the audiomunge debug output.

Make sure we always show information about the segment events passing through,
even when pre-roll audio buffers aren't going to be needed.
This commit is contained in:
Jan Schmidt 2009-05-11 11:06:03 +01:00
parent ad1f7e6ed3
commit 79f653fde8

View file

@ -288,15 +288,12 @@ rsn_audiomunge_sink_event (GstPad * pad, GstEvent * event)
gst_segment_set_newsegment_full (segment, update, gst_segment_set_newsegment_full (segment, update,
rate, arate, format, start, stop, time); rate, arate, format, start, stop, time);
if (munge->have_audio) {
ret = gst_pad_push_event (munge->srcpad, event);
break;
}
/* /*
* FIXME: * FIXME:
* If the accum >= threshold or we're in a still frame and there's been * If this is a segment update and accum >= threshold,
* no audio received, then we need to generate some audio data. * or we're in a still frame and there's been no audio received,
* then we need to generate some audio data.
*
* If caused by a segment start update (time advancing in a gap) adjust * If caused by a segment start update (time advancing in a gap) adjust
* the new-segment and send the buffer. * the new-segment and send the buffer.
* *
@ -304,17 +301,21 @@ rsn_audiomunge_sink_event (GstPad * pad, GstEvent * event)
* in the closing segment. * in the closing segment.
*/ */
if (!update) { if (!update) {
GST_DEBUG_OBJECT (munge, "Sending newsegment: start %" GST_TIME_FORMAT GST_DEBUG_OBJECT (munge,
" stop %" GST_TIME_FORMAT " accum now %" GST_TIME_FORMAT, "Sending newsegment: update %d start %" GST_TIME_FORMAT " stop %"
GST_TIME_FORMAT " accum now %" GST_TIME_FORMAT, update,
GST_TIME_ARGS (start), GST_TIME_ARGS (stop), GST_TIME_ARGS (start), GST_TIME_ARGS (stop),
GST_TIME_ARGS (segment->accum)); GST_TIME_ARGS (segment->accum));
ret = gst_pad_push_event (munge->srcpad, event); ret = gst_pad_push_event (munge->srcpad, event);
} }
if (segment->accum >= AUDIO_FILL_THRESHOLD || munge->in_still) { if (!munge->have_audio) {
if ((update && segment->accum >= AUDIO_FILL_THRESHOLD)
|| munge->in_still) {
GST_DEBUG_OBJECT (munge, GST_DEBUG_OBJECT (munge,
"Sending audio fill: accum = %" GST_TIME_FORMAT " still-state=%d", "Sending audio fill with ts %" GST_TIME_FORMAT ": accum = %"
GST_TIME_FORMAT " still-state=%d", GST_TIME_ARGS (segment->start),
GST_TIME_ARGS (segment->accum), munge->in_still); GST_TIME_ARGS (segment->accum), munge->in_still);
/* Just generate a 100ms silence buffer for now. FIXME: Fill the gap */ /* Just generate a 100ms silence buffer for now. FIXME: Fill the gap */
@ -323,13 +324,15 @@ rsn_audiomunge_sink_event (GstPad * pad, GstEvent * event)
munge->have_audio = TRUE; munge->have_audio = TRUE;
} else { } else {
GST_LOG_OBJECT (munge, "Not sending audio fill buffer: " GST_LOG_OBJECT (munge, "Not sending audio fill buffer: "
"segment accum below thresh: accum = %" GST_TIME_FORMAT, "Not segment update, or segment accum below thresh: accum = %"
GST_TIME_ARGS (segment->accum)); GST_TIME_FORMAT, GST_TIME_ARGS (segment->accum));
}
} }
if (update) { if (update) {
GST_DEBUG_OBJECT (munge, "Sending newsegment: start %" GST_TIME_FORMAT GST_DEBUG_OBJECT (munge,
" stop %" GST_TIME_FORMAT " accum now %" GST_TIME_FORMAT, "Sending newsegment: update %d start %" GST_TIME_FORMAT " stop %"
GST_TIME_FORMAT " accum now %" GST_TIME_FORMAT, update,
GST_TIME_ARGS (start), GST_TIME_ARGS (stop), GST_TIME_ARGS (start), GST_TIME_ARGS (stop),
GST_TIME_ARGS (segment->accum)); GST_TIME_ARGS (segment->accum));