ext/dv/gstdvdemux.c (gst_dvdemux_demux_frame): Send out valid segment end timestamps.

Original commit message from CVS:
2005-08-24  Andy Wingo  <wingo@pobox.com>

* ext/dv/gstdvdemux.c (gst_dvdemux_demux_frame): Send out valid
segment end timestamps.

(Also commit an old changelog entry)
This commit is contained in:
Andy Wingo 2005-08-24 15:51:48 +00:00
parent 122cdbe814
commit 7cc995f71b
2 changed files with 21 additions and 10 deletions

View file

@ -1,3 +1,8 @@
2005-08-24 Andy Wingo <wingo@pobox.com>
* ext/dv/gstdvdemux.c (gst_dvdemux_demux_frame): Send out valid
segment end timestamps.
2005-08-24 Thomas Vander Stichele <thomas at apestaart dot org>
* configure.ac:
@ -328,6 +333,11 @@
2005-08-16 Andy Wingo <wingo@pobox.com>
* ext/dv/gstdvdemux.c (gst_dvdemux_flush): Use gst_adapter_take so
we have our own copy of the data.
(gst_dvdemux_demux_video): Set the take() data as malloc_data so
it will get freed later.
* ext/raw1394/gstdv1394src.c (gst_dv1394src_iso_receive): Note
license info in the source code -- was only in the commit log
before.

View file

@ -779,9 +779,8 @@ gst_dvdemux_demux_video (GstDVDemux * dvdemux, const guint8 * data)
outbuf = gst_buffer_new ();
/* won't get freed, but still callers should not hold a ref on the buffer --
need to figure out how to do that in gst core */
gst_buffer_set_data (outbuf, (guint8 *) data, dvdemux->frame_len);
outbuf->malloc_data = GST_BUFFER_DATA (outbuf);
GST_BUFFER_TIMESTAMP (outbuf) = dvdemux->timestamp;
GST_BUFFER_OFFSET (outbuf) = dvdemux->video_offset;
@ -821,11 +820,15 @@ gst_dvdemux_demux_frame (GstDVDemux * dvdemux, const guint8 * data)
dvdemux->timestamp = dvdemux->start_timestamp;
format = GST_FORMAT_TIME;
if (!(res = gst_pad_query_convert (dvdemux->sinkpad,
GST_FORMAT_BYTES,
dvdemux->stop_byte, &format, &dvdemux->stop_timestamp))) {
goto discont_error;
if (dvdemux->stop_byte == -1) {
dvdemux->stop_timestamp = -1;
} else {
format = GST_FORMAT_TIME;
if (!(res = gst_pad_query_convert (dvdemux->sinkpad,
GST_FORMAT_BYTES,
dvdemux->stop_byte, &format, &dvdemux->stop_timestamp))) {
goto discont_error;
}
}
event = gst_event_new_newsegment (1.0, GST_FORMAT_TIME,
@ -897,13 +900,11 @@ gst_dvdemux_flush (GstDVDemux * dvdemux)
/* if we still have enough for a frame, start decoding */
if (gst_adapter_available (dvdemux->adapter) >= length) {
data = gst_adapter_peek (dvdemux->adapter, length);
data = gst_adapter_take (dvdemux->adapter, length);
/* and decode the data */
ret = gst_dvdemux_demux_frame (dvdemux, data);
gst_adapter_flush (dvdemux->adapter, length);
if (ret != GST_FLOW_OK)
goto done;
}