mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
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.
This commit is contained in:
parent
4c0af72b12
commit
0230754d77
3 changed files with 23 additions and 2 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
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>
|
2006-11-28 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* gst/playback/gstplaybasebin.c: (check_queue_event):
|
* 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);
|
GstClockTime ts = GST_BUFFER_TIMESTAMP (buffer);
|
||||||
GstClockTimeDiff max_diff;
|
GstClockTimeDiff max_diff;
|
||||||
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
/* Allow 3/4 a frame off */
|
/* Allow 3/4 a frame off */
|
||||||
max_diff = (enc->info.fps_denominator * GST_SECOND * 3) /
|
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
|
" exceeds expected value %" GST_TIME_FORMAT
|
||||||
" by too much, marking discontinuity",
|
" by too much, marking discontinuity",
|
||||||
GST_TIME_ARGS (ts), GST_TIME_ARGS (enc->expected_ts));
|
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
|
else
|
||||||
enc->expected_ts = GST_CLOCK_TIME_NONE;
|
enc->expected_ts = GST_CLOCK_TIME_NONE;
|
||||||
|
|
||||||
return FALSE;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
|
|
|
@ -383,6 +383,15 @@ GST_START_TEST (test_discontinuity)
|
||||||
fail_unless (GST_BUFFER_IS_DISCONT (buffer),
|
fail_unless (GST_BUFFER_IS_DISCONT (buffer),
|
||||||
"expected discontinuous buffer yo");
|
"expected discontinuous buffer yo");
|
||||||
gst_buffer_unref (buffer);
|
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);
|
gst_buffer_straw_stop_pipeline (bin, pad);
|
||||||
|
|
Loading…
Reference in a new issue