gst/videorate/gstvideorate.c (gst_video_rate_flush_prev): Properly handle the case where you get EOS before any buffe...

Original commit message from CVS:
2006-04-04  Andy Wingo  <wingo@pobox.com>

* gst/videorate/gstvideorate.c (gst_video_rate_flush_prev):
Properly handle the case where you get EOS before any buffers are
received. Use gst_buffer_make_metadata_writable where appropriate.
This commit is contained in:
Andy Wingo 2006-04-04 11:15:00 +00:00
parent 76d5f5e214
commit a0ffc95d5d
2 changed files with 14 additions and 3 deletions

View file

@ -1,5 +1,9 @@
2006-04-04 Andy Wingo <wingo@pobox.com>
* gst/videorate/gstvideorate.c (gst_video_rate_flush_prev):
Properly handle the case where you get EOS before any buffers are
received. Use gst_buffer_make_metadata_writable where appropriate.
* ext/theora/theoradec.c (theora_handle_data_packet): This value
is often negative -- make it signed so as not to wrap around.
Fixes segfaults introduced on 9 March.

View file

@ -405,10 +405,11 @@ gst_video_rate_flush_prev (GstVideoRate * videorate)
GstBuffer *outbuf;
GstClockTime push_ts;
if (!videorate->prevbuf)
goto eos_before_buffers;
/* make sure we can write to the metadata */
outbuf =
gst_buffer_create_sub (videorate->prevbuf, 0,
GST_BUFFER_SIZE (videorate->prevbuf));
outbuf = gst_buffer_make_metadata_writable (videorate->prevbuf);
/* this is the timestamp we put on the buffer */
push_ts = videorate->next_ts;
@ -436,6 +437,12 @@ gst_video_rate_flush_prev (GstVideoRate * videorate)
return res;
/* WARNINGS */
eos_before_buffers:
{
GST_INFO_OBJECT (videorate, "got EOS before any buffer was received");
return GST_FLOW_OK;
}
/* ERRORS */
push_error:
{