Commit 0230754d authored by Michael Smith's avatar Michael Smith
Browse files

tests/check/pipelines/theoraenc.c: It would be very bad if, after a discont...

tests/check/pipelines/theoraenc.c: It would be very bad if, after a discont buffer, we thought every single following...

Original commit message from CVS:
* tests/check/pipelines/theoraenc.c: (check_buffer_granulepos),
(GST_START_TEST):
It would be very bad if, after a discont buffer, we thought every
single following buffer was also discont. So, add to the test to
ensure that this isn't the case.

* ext/theora/theoraenc.c: (theora_enc_is_discontinuous):
... it was the case. So fix it.
parent 4c0af72b
2006-11-30 Michael Smith <msmith@fluendo.com>
* tests/check/pipelines/theoraenc.c: (check_buffer_granulepos),
(GST_START_TEST):
It would be very bad if, after a discont buffer, we thought every
single following buffer was also discont. So, add to the test to
ensure that this isn't the case.
* ext/theora/theoraenc.c: (theora_enc_is_discontinuous):
... it was the case. So fix it.
2006-11-28 Wim Taymans <wim@fluendo.com>
 
* gst/playback/gstplaybasebin.c: (check_queue_event):
......@@ -574,6 +574,7 @@ theora_enc_is_discontinuous (GstTheoraEnc * enc, GstBuffer * buffer)
{
GstClockTime ts = GST_BUFFER_TIMESTAMP (buffer);
GstClockTimeDiff max_diff;
gboolean ret = FALSE;
/* Allow 3/4 a frame off */
max_diff = (enc->info.fps_denominator * GST_SECOND * 3) /
......@@ -585,7 +586,7 @@ theora_enc_is_discontinuous (GstTheoraEnc * enc, GstBuffer * buffer)
" exceeds expected value %" GST_TIME_FORMAT
" by too much, marking discontinuity",
GST_TIME_ARGS (ts), GST_TIME_ARGS (enc->expected_ts));
return TRUE;
ret = TRUE;
}
}
......@@ -594,7 +595,7 @@ theora_enc_is_discontinuous (GstTheoraEnc * enc, GstBuffer * buffer)
else
enc->expected_ts = GST_CLOCK_TIME_NONE;
return FALSE;
return ret;
}
static GstFlowReturn
......
......@@ -383,6 +383,15 @@ GST_START_TEST (test_discontinuity)
fail_unless (GST_BUFFER_IS_DISCONT (buffer),
"expected discontinuous buffer yo");
gst_buffer_unref (buffer);
/* Then the buffer after that should be continuous */
buffer = gst_buffer_straw_get_buffer (bin, pad);
fail_if (GST_BUFFER_IS_DISCONT (buffer), "expected continuous buffer yo");
/* plain division because I know the answer is exact */
check_buffer_duration (buffer, GST_SECOND / 10);
check_buffer_granulepos (buffer, (2 << GRANULEPOS_SHIFT) + 1);
check_buffer_is_header (buffer, FALSE);
gst_buffer_unref (buffer);
}
gst_buffer_straw_stop_pipeline (bin, pad);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment