diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2008-01-19 15:53:38 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2008-01-19 15:53:38 +0000 |
commit | a0283af747eb72ba84298d2a264f957fc4fb8ea3 (patch) | |
tree | ea40b9dfce35c0d6440f98025404c04dbb8eac73 /gst/rawparse | |
parent | c7fcd9d5ae4f4ef2ea1a50542fa7ca93673cde8a (diff) | |
download | gst-plugins-bad-a0283af747eb72ba84298d2a264f957fc4fb8ea3.tar.gz gst-plugins-bad-a0283af747eb72ba84298d2a264f957fc4fb8ea3.tar.bz2 gst-plugins-bad-a0283af747eb72ba84298d2a264f957fc4fb8ea3.zip |
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.
Diffstat (limited to 'gst/rawparse')
-rw-r--r-- | gst/rawparse/gstrawparse.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gst/rawparse/gstrawparse.c b/gst/rawparse/gstrawparse.c index 16a6b9f7..be7549b0 100644 --- a/gst/rawparse/gstrawparse.c +++ b/gst/rawparse/gstrawparse.c @@ -304,13 +304,14 @@ gst_raw_parse_loop (GstElement * element) if (rp->offset + size > rp->upstream_length) { GstFormat fmt = GST_FORMAT_BYTES; - if (!gst_pad_query_peer_duration (rp->sinkpad, &fmt, &rp->upstream_length) - || rp->upstream_length < rp->offset + rp->framesize) { + if (!gst_pad_query_peer_duration (rp->sinkpad, &fmt, &rp->upstream_length)) { + 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; goto pause; - } - - if (rp->offset + size > rp->upstream_length) { + } else if (rp->offset + size > rp->upstream_length) { size = rp->upstream_length - rp->offset; size -= size % rp->framesize; } |