mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-06-16 13:00:41 +00:00
- Make _tell more accurate
Original commit message from CVS: - Make _tell more accurate
This commit is contained in:
parent
de6bcd890a
commit
d6469f9688
|
@ -239,9 +239,9 @@ gst_bytestream_peek (GstByteStream *bs, GstBuffer **buf, guint32 len)
|
||||||
/* make sure we have enough */
|
/* make sure we have enough */
|
||||||
bs_print ("peek: there are %d bytes in the list", bs->listavail);
|
bs_print ("peek: there are %d bytes in the list", bs->listavail);
|
||||||
if (len > bs->listavail) {
|
if (len > bs->listavail) {
|
||||||
if (!gst_bytestream_fill_bytes (bs, len)){
|
if (!gst_bytestream_fill_bytes (bs, len)) {
|
||||||
/* we must have an event coming up */
|
/* we must have an event coming up */
|
||||||
if (bs->listavail > 0){
|
if (bs->listavail > 0) {
|
||||||
/* we have some data left, len will be shrunk to the amount of data available */
|
/* we have some data left, len will be shrunk to the amount of data available */
|
||||||
len = bs->listavail;
|
len = bs->listavail;
|
||||||
}
|
}
|
||||||
|
@ -492,8 +492,9 @@ gst_bytestream_tell (GstByteStream *bs)
|
||||||
|
|
||||||
format = GST_FORMAT_BYTES;
|
format = GST_FORMAT_BYTES;
|
||||||
|
|
||||||
if (gst_pad_query (GST_PAD_PEER (bs->pad), GST_QUERY_POSITION, &format, &value))
|
if (gst_pad_query (GST_PAD_PEER (bs->pad), GST_QUERY_POSITION, &format, &value)) {
|
||||||
return value;
|
return value - bs->listavail;
|
||||||
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue