mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 21:28:45 +00:00
gst/rawparse/gstrawparse.c: Improve handling of unknown or too small upstream sizes in pull mode.
Original commit message from CVS: * gst/rawparse/gstrawparse.c: (gst_raw_parse_loop): Improve handling of unknown or too small upstream sizes in pull mode.
This commit is contained in:
parent
c7fcd9d5ae
commit
a0283af747
2 changed files with 12 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2008-01-19 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
|
* gst/rawparse/gstrawparse.c: (gst_raw_parse_loop):
|
||||||
|
Improve handling of unknown or too small upstream sizes in
|
||||||
|
pull mode.
|
||||||
|
|
||||||
2008-01-19 Sebastian Dröge <slomo@circular-chaos.org>
|
2008-01-19 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
* gst/rawparse/gstrawparse.c: (gst_raw_parse_loop),
|
* gst/rawparse/gstrawparse.c: (gst_raw_parse_loop),
|
||||||
|
|
|
@ -304,13 +304,14 @@ gst_raw_parse_loop (GstElement * element)
|
||||||
if (rp->offset + size > rp->upstream_length) {
|
if (rp->offset + size > rp->upstream_length) {
|
||||||
GstFormat fmt = GST_FORMAT_BYTES;
|
GstFormat fmt = GST_FORMAT_BYTES;
|
||||||
|
|
||||||
if (!gst_pad_query_peer_duration (rp->sinkpad, &fmt, &rp->upstream_length)
|
if (!gst_pad_query_peer_duration (rp->sinkpad, &fmt, &rp->upstream_length)) {
|
||||||
|| rp->upstream_length < rp->offset + rp->framesize) {
|
GST_WARNING_OBJECT (rp,
|
||||||
|
"Could not get upstream duration, trying to pull frame by frame");
|
||||||
|
size = rp->framesize;
|
||||||
|
} else if (rp->upstream_length < rp->offset + rp->framesize) {
|
||||||
ret = GST_FLOW_UNEXPECTED;
|
ret = GST_FLOW_UNEXPECTED;
|
||||||
goto pause;
|
goto pause;
|
||||||
}
|
} else if (rp->offset + size > rp->upstream_length) {
|
||||||
|
|
||||||
if (rp->offset + size > rp->upstream_length) {
|
|
||||||
size = rp->upstream_length - rp->offset;
|
size = rp->upstream_length - rp->offset;
|
||||||
size -= size % rp->framesize;
|
size -= size % rp->framesize;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue