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.
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.
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;
return res;
+ /* WARNINGS */
+eos_before_buffers:
+ {
+ GST_INFO_OBJECT (videorate, "got EOS before any buffer was received");
+ return GST_FLOW_OK;
+ }
/* ERRORS */
push_error:
{