Skip to content

media: Check whether an InputStream is seekable

Fabiano Fidêncio requested to merge fidencio/libosinfo:wip/g_seekable into master

SoupInputStream is not seekable, causing errors as:

fidencio@laerte ~/src/upstream/libosinfo $ ./tools/osinfo-detect https://cdimage.debian.org/cdimage/archive/8.10.0/powerpc/iso-dvd/debian-8.10.0-powerpc-DVD-1.iso
(lt-osinfo-detect:27922): GLib-GObject-WARNING **: 18:52:29.494: invalid cast from 'SoupClientInputStream' to 'GSeekable'
(lt-osinfo-detect:27922): GLib-GIO-CRITICAL **: 18:52:29.494: g_seekable_seek: assertion 'G_IS_SEEKABLE (seekable)' failed
(lt-osinfo-detect:27922): GLib-GIO-CRITICAL **: 18:52:29.494: g_task_return_error: assertion 'error != NULL' failed

In order toa void those, let's check whther the InputStream is seekable or not.

NOTE: This patch is a band-aid while we wait for a proper solution ... which either will be implementing an OsinfoInputStream or patching libsoup itself.

Merge request reports