/* rygel-http-byte-seek.c generated by valac 0.15.1.36-84b2b, the Vala compiler
 * generated from rygel-http-byte-seek.vala, do not modify */

/*
 * Copyright (C) 2009 Nokia Corporation.
 *
 * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
 *                               <zeeshan.ali@nokia.com>
 *
 * This file is part of Rygel.
 *
 * Rygel is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Rygel is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <libsoup/soup.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>


#define RYGEL_TYPE_HTTP_SEEK (rygel_http_seek_get_type ())
#define RYGEL_HTTP_SEEK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_HTTP_SEEK, RygelHTTPSeek))
#define RYGEL_HTTP_SEEK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_HTTP_SEEK, RygelHTTPSeekClass))
#define RYGEL_IS_HTTP_SEEK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_HTTP_SEEK))
#define RYGEL_IS_HTTP_SEEK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_HTTP_SEEK))
#define RYGEL_HTTP_SEEK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_HTTP_SEEK, RygelHTTPSeekClass))

typedef struct _RygelHTTPSeek RygelHTTPSeek;
typedef struct _RygelHTTPSeekClass RygelHTTPSeekClass;
typedef struct _RygelHTTPSeekPrivate RygelHTTPSeekPrivate;

#define RYGEL_TYPE_HTTP_BYTE_SEEK (rygel_http_byte_seek_get_type ())
#define RYGEL_HTTP_BYTE_SEEK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_HTTP_BYTE_SEEK, RygelHTTPByteSeek))
#define RYGEL_HTTP_BYTE_SEEK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_HTTP_BYTE_SEEK, RygelHTTPByteSeekClass))
#define RYGEL_IS_HTTP_BYTE_SEEK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_HTTP_BYTE_SEEK))
#define RYGEL_IS_HTTP_BYTE_SEEK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_HTTP_BYTE_SEEK))
#define RYGEL_HTTP_BYTE_SEEK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_HTTP_BYTE_SEEK, RygelHTTPByteSeekClass))

typedef struct _RygelHTTPByteSeek RygelHTTPByteSeek;
typedef struct _RygelHTTPByteSeekClass RygelHTTPByteSeekClass;
typedef struct _RygelHTTPByteSeekPrivate RygelHTTPByteSeekPrivate;

#define RYGEL_TYPE_HTTP_GET (rygel_http_get_get_type ())
#define RYGEL_HTTP_GET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_HTTP_GET, RygelHTTPGet))
#define RYGEL_HTTP_GET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_HTTP_GET, RygelHTTPGetClass))
#define RYGEL_IS_HTTP_GET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_HTTP_GET))
#define RYGEL_IS_HTTP_GET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_HTTP_GET))
#define RYGEL_HTTP_GET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_HTTP_GET, RygelHTTPGetClass))

typedef struct _RygelHTTPGet RygelHTTPGet;
typedef struct _RygelHTTPGetClass RygelHTTPGetClass;
typedef struct _RygelHTTPGetPrivate RygelHTTPGetPrivate;

#define RYGEL_TYPE_MEDIA_ITEM (rygel_media_item_get_type ())
#define RYGEL_MEDIA_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_MEDIA_ITEM, RygelMediaItem))
#define RYGEL_MEDIA_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_MEDIA_ITEM, RygelMediaItemClass))
#define RYGEL_IS_MEDIA_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_MEDIA_ITEM))
#define RYGEL_IS_MEDIA_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_MEDIA_ITEM))
#define RYGEL_MEDIA_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_MEDIA_ITEM, RygelMediaItemClass))

typedef struct _RygelMediaItem RygelMediaItem;
typedef struct _RygelMediaItemClass RygelMediaItemClass;

#define RYGEL_TYPE_THUMBNAIL (rygel_thumbnail_get_type ())
#define RYGEL_THUMBNAIL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_THUMBNAIL, RygelThumbnail))
#define RYGEL_THUMBNAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_THUMBNAIL, RygelThumbnailClass))
#define RYGEL_IS_THUMBNAIL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_THUMBNAIL))
#define RYGEL_IS_THUMBNAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_THUMBNAIL))
#define RYGEL_THUMBNAIL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_THUMBNAIL, RygelThumbnailClass))

typedef struct _RygelThumbnail RygelThumbnail;
typedef struct _RygelThumbnailClass RygelThumbnailClass;

#define RYGEL_TYPE_SUBTITLE (rygel_subtitle_get_type ())
#define RYGEL_SUBTITLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_SUBTITLE, RygelSubtitle))
#define RYGEL_SUBTITLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_SUBTITLE, RygelSubtitleClass))
#define RYGEL_IS_SUBTITLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_SUBTITLE))
#define RYGEL_IS_SUBTITLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_SUBTITLE))
#define RYGEL_SUBTITLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_SUBTITLE, RygelSubtitleClass))

typedef struct _RygelSubtitle RygelSubtitle;
typedef struct _RygelSubtitleClass RygelSubtitleClass;

#define RYGEL_TYPE_HTTP_IDENTITY_HANDLER (rygel_http_identity_handler_get_type ())
#define RYGEL_HTTP_IDENTITY_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_HTTP_IDENTITY_HANDLER, RygelHTTPIdentityHandler))
#define RYGEL_HTTP_IDENTITY_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_HTTP_IDENTITY_HANDLER, RygelHTTPIdentityHandlerClass))
#define RYGEL_IS_HTTP_IDENTITY_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_HTTP_IDENTITY_HANDLER))
#define RYGEL_IS_HTTP_IDENTITY_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_HTTP_IDENTITY_HANDLER))
#define RYGEL_HTTP_IDENTITY_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_HTTP_IDENTITY_HANDLER, RygelHTTPIdentityHandlerClass))

typedef struct _RygelHTTPIdentityHandler RygelHTTPIdentityHandler;
typedef struct _RygelHTTPIdentityHandlerClass RygelHTTPIdentityHandlerClass;
typedef struct _RygelThumbnailPrivate RygelThumbnailPrivate;
typedef struct _RygelSubtitlePrivate RygelSubtitlePrivate;
typedef struct _RygelMediaItemPrivate RygelMediaItemPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _RygelHTTPSeek {
	GObject parent_instance;
	RygelHTTPSeekPrivate * priv;
};

struct _RygelHTTPSeekClass {
	GObjectClass parent_class;
	void (*add_response_headers) (RygelHTTPSeek* self);
};

struct _RygelHTTPByteSeek {
	RygelHTTPSeek parent_instance;
	RygelHTTPByteSeekPrivate * priv;
};

struct _RygelHTTPByteSeekClass {
	RygelHTTPSeekClass parent_class;
};

typedef enum  {
	RYGEL_HTTP_SEEK_ERROR_INVALID_RANGE = SOUP_STATUS_BAD_REQUEST,
	RYGEL_HTTP_SEEK_ERROR_OUT_OF_RANGE = SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE
} RygelHTTPSeekError;
#define RYGEL_HTTP_SEEK_ERROR rygel_http_seek_error_quark ()
struct _RygelHTTPGet {
	GObject parent_instance;
	RygelHTTPGetPrivate * priv;
	SoupMessage* msg;
	RygelMediaItem* item;
	RygelThumbnail* thumbnail;
	RygelSubtitle* subtitle;
	RygelHTTPIdentityHandler* handler;
};

struct _RygelHTTPGetClass {
	GObjectClass parent_class;
};

struct _RygelThumbnail {
	GObject parent_instance;
	RygelThumbnailPrivate * priv;
	gint64 size;
};

struct _RygelThumbnailClass {
	GObjectClass parent_class;
};

struct _RygelSubtitle {
	GObject parent_instance;
	RygelSubtitlePrivate * priv;
	gint64 size;
};

struct _RygelSubtitleClass {
	GObjectClass parent_class;
};

struct _RygelMediaItem {
	GObject parent_instance;
	RygelMediaItemPrivate * priv;
	gint64 size;
};

struct _RygelMediaItemClass {
	GObjectClass parent_class;
};


static gpointer rygel_http_byte_seek_parent_class = NULL;

GType rygel_http_seek_get_type (void) G_GNUC_CONST;
GType rygel_http_byte_seek_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_HTTP_BYTE_SEEK_DUMMY_PROPERTY
};
GType rygel_http_get_get_type (void) G_GNUC_CONST;
GQuark rygel_http_seek_error_quark (void);
RygelHTTPByteSeek* rygel_http_byte_seek_new (RygelHTTPGet* request, GError** error);
RygelHTTPByteSeek* rygel_http_byte_seek_construct (GType object_type, RygelHTTPGet* request, GError** error);
GType rygel_media_item_get_type (void) G_GNUC_CONST;
GType rygel_thumbnail_get_type (void) G_GNUC_CONST;
GType rygel_subtitle_get_type (void) G_GNUC_CONST;
GType rygel_http_identity_handler_get_type (void) G_GNUC_CONST;
RygelHTTPSeek* rygel_http_seek_construct (GType object_type, SoupMessage* msg, gint64 start, gint64 stop, gint64 step, gint64 total_length, GError** error);
gboolean rygel_http_byte_seek_needed (RygelHTTPGet* request);
gboolean rygel_http_byte_seek_requested (RygelHTTPGet* request);
static void rygel_http_byte_seek_real_add_response_headers (RygelHTTPSeek* base);
SoupMessage* rygel_http_seek_get_msg (RygelHTTPSeek* self);
gint64 rygel_http_seek_get_start (RygelHTTPSeek* self);
gint64 rygel_http_seek_get_stop (RygelHTTPSeek* self);
gint64 rygel_http_seek_get_total_length (RygelHTTPSeek* self);
gint64 rygel_http_seek_get_length (RygelHTTPSeek* self);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


static glong string_strnlen (gchar* str, glong maxlen) {
	glong result = 0L;
	gchar* _tmp0_;
	glong _tmp1_;
	gchar* _tmp2_ = NULL;
	gchar* end;
	gchar* _tmp3_;
#line 1304 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp0_ = str;
#line 1304 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp1_ = maxlen;
#line 1304 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
#line 1304 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	end = _tmp2_;
#line 1305 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp3_ = end;
#line 1305 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	if (_tmp3_ == NULL) {
#line 231 "rygel-http-byte-seek.c"
		glong _tmp4_;
#line 1306 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp4_ = maxlen;
#line 1306 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		result = _tmp4_;
#line 1306 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		return result;
#line 239 "rygel-http-byte-seek.c"
	} else {
		gchar* _tmp5_;
		gchar* _tmp6_;
#line 1308 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp5_ = end;
#line 1308 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp6_ = str;
#line 1308 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		result = (glong) (_tmp5_ - _tmp6_);
#line 1308 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		return result;
#line 251 "rygel-http-byte-seek.c"
	}
}


static gchar* string_substring (const gchar* self, glong offset, glong len) {
	gchar* result = NULL;
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	glong _tmp1_;
	gboolean _tmp3_;
	glong _tmp9_;
	glong _tmp15_;
	glong _tmp18_;
	glong _tmp19_;
	glong _tmp20_;
	glong _tmp21_;
	glong _tmp22_;
	gchar* _tmp23_ = NULL;
#line 1315 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1317 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp1_ = offset;
#line 1317 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	if (_tmp1_ >= ((glong) 0)) {
#line 276 "rygel-http-byte-seek.c"
		glong _tmp2_;
#line 1317 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp2_ = len;
#line 1317 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp0_ = _tmp2_ >= ((glong) 0);
#line 282 "rygel-http-byte-seek.c"
	} else {
#line 1317 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp0_ = FALSE;
#line 286 "rygel-http-byte-seek.c"
	}
#line 1317 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp3_ = _tmp0_;
#line 1317 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	if (_tmp3_) {
#line 292 "rygel-http-byte-seek.c"
		glong _tmp4_;
		glong _tmp5_;
		glong _tmp6_ = 0L;
#line 1319 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp4_ = offset;
#line 1319 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp5_ = len;
#line 1319 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp6_ = string_strnlen ((gchar*) self, _tmp4_ + _tmp5_);
#line 1319 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		string_length = _tmp6_;
#line 304 "rygel-http-byte-seek.c"
	} else {
		gint _tmp7_;
		gint _tmp8_;
#line 1321 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp7_ = strlen (self);
#line 1321 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp8_ = _tmp7_;
#line 1321 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		string_length = (glong) _tmp8_;
#line 314 "rygel-http-byte-seek.c"
	}
#line 1324 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp9_ = offset;
#line 1324 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	if (_tmp9_ < ((glong) 0)) {
#line 320 "rygel-http-byte-seek.c"
		glong _tmp10_;
		glong _tmp11_;
		glong _tmp12_;
#line 1325 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp10_ = string_length;
#line 1325 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp11_ = offset;
#line 1325 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		offset = _tmp10_ + _tmp11_;
#line 1326 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp12_ = offset;
#line 1326 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		g_return_val_if_fail (_tmp12_ >= ((glong) 0), NULL);
#line 334 "rygel-http-byte-seek.c"
	} else {
		glong _tmp13_;
		glong _tmp14_;
#line 1328 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp13_ = offset;
#line 1328 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp14_ = string_length;
#line 1328 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		g_return_val_if_fail (_tmp13_ <= _tmp14_, NULL);
#line 344 "rygel-http-byte-seek.c"
	}
#line 1330 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp15_ = len;
#line 1330 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	if (_tmp15_ < ((glong) 0)) {
#line 350 "rygel-http-byte-seek.c"
		glong _tmp16_;
		glong _tmp17_;
#line 1331 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp16_ = string_length;
#line 1331 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		_tmp17_ = offset;
#line 1331 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
		len = _tmp16_ - _tmp17_;
#line 359 "rygel-http-byte-seek.c"
	}
#line 1333 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp18_ = offset;
#line 1333 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp19_ = len;
#line 1333 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp20_ = string_length;
#line 1333 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	g_return_val_if_fail ((_tmp18_ + _tmp19_) <= _tmp20_, NULL);
#line 1334 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp21_ = offset;
#line 1334 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp22_ = len;
#line 1334 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp23_ = g_strndup (((gchar*) self) + _tmp21_, (gsize) _tmp22_);
#line 1334 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	result = _tmp23_;
#line 1334 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	return result;
#line 379 "rygel-http-byte-seek.c"
}


static gchar string_get (const gchar* self, glong index) {
	gchar result = '\0';
	glong _tmp0_;
	gchar _tmp1_;
#line 1125 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, '\0');
#line 1126 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp0_ = index;
#line 1126 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp1_ = ((gchar*) self)[_tmp0_];
#line 1126 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	result = _tmp1_;
#line 1126 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	return result;
#line 397 "rygel-http-byte-seek.c"
}


static gint64 int64_parse (const gchar* str) {
	gint64 result = 0LL;
	const gchar* _tmp0_;
	gint64 _tmp1_ = 0LL;
#line 593 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	g_return_val_if_fail (str != NULL, 0LL);
#line 594 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp0_ = str;
#line 594 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	_tmp1_ = g_ascii_strtoll (_tmp0_, NULL, (guint) 0);
#line 594 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	result = _tmp1_;
#line 594 "/opt/gnome2/share/vala-0.16/vapi/glib-2.0.vapi"
	return result;
#line 415 "rygel-http-byte-seek.c"
}


RygelHTTPByteSeek* rygel_http_byte_seek_construct (GType object_type, RygelHTTPGet* request, GError** error) {
	RygelHTTPByteSeek * self = NULL;
	gchar* range = NULL;
	gchar* pos = NULL;
	gchar** range_tokens = NULL;
	gint range_tokens_length1 = 0;
	gint _range_tokens_size_ = 0;
	gint64 start;
	gint64 total_length = 0LL;
	RygelHTTPGet* _tmp0_;
	RygelThumbnail* _tmp1_;
	gint64 _tmp13_;
	gint64 stop;
	RygelHTTPGet* _tmp14_;
	SoupMessage* _tmp15_;
	SoupMessageHeaders* _tmp16_;
	const gchar* _tmp17_ = NULL;
	gchar* _tmp18_;
	const gchar* _tmp19_;
	RygelHTTPGet* _tmp68_;
	SoupMessage* _tmp69_;
	gint64 _tmp70_;
	gint64 _tmp71_;
	gint64 _tmp72_;
	GError * _inner_error_ = NULL;
#line 25 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	g_return_val_if_fail (request != NULL, NULL);
#line 28 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	start = (gint64) 0;
#line 30 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp0_ = request;
#line 30 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp1_ = _tmp0_->thumbnail;
#line 30 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	if (_tmp1_ != NULL) {
#line 454 "rygel-http-byte-seek.c"
		RygelHTTPGet* _tmp2_;
		RygelThumbnail* _tmp3_;
		gint64 _tmp4_;
#line 31 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp2_ = request;
#line 31 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp3_ = _tmp2_->thumbnail;
#line 31 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp4_ = _tmp3_->size;
#line 31 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		total_length = _tmp4_;
#line 466 "rygel-http-byte-seek.c"
	} else {
		RygelHTTPGet* _tmp5_;
		RygelSubtitle* _tmp6_;
#line 32 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp5_ = request;
#line 32 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp6_ = _tmp5_->subtitle;
#line 32 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		if (_tmp6_ != NULL) {
#line 476 "rygel-http-byte-seek.c"
			RygelHTTPGet* _tmp7_;
			RygelSubtitle* _tmp8_;
			gint64 _tmp9_;
#line 33 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp7_ = request;
#line 33 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp8_ = _tmp7_->subtitle;
#line 33 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp9_ = _tmp8_->size;
#line 33 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			total_length = _tmp9_;
#line 488 "rygel-http-byte-seek.c"
		} else {
			RygelHTTPGet* _tmp10_;
			RygelMediaItem* _tmp11_;
			gint64 _tmp12_;
#line 35 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp10_ = request;
#line 35 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp11_ = _tmp10_->item;
#line 35 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp12_ = _tmp11_->size;
#line 35 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			total_length = _tmp12_;
#line 501 "rygel-http-byte-seek.c"
		}
	}
#line 37 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp13_ = total_length;
#line 37 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	stop = _tmp13_ - 1;
#line 39 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp14_ = request;
#line 39 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp15_ = _tmp14_->msg;
#line 39 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp16_ = _tmp15_->request_headers;
#line 39 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp17_ = soup_message_headers_get_one (_tmp16_, "Range");
#line 39 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp18_ = g_strdup (_tmp17_);
#line 39 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_g_free0 (range);
#line 39 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	range = _tmp18_;
#line 40 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp19_ = range;
#line 40 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	if (_tmp19_ != NULL) {
#line 526 "rygel-http-byte-seek.c"
		const gchar* _tmp20_;
		gboolean _tmp21_ = FALSE;
		const gchar* _tmp25_;
		gchar* _tmp26_ = NULL;
		gchar* _tmp27_;
		gchar** _tmp28_;
		gchar** _tmp29_ = NULL;
		gboolean _tmp30_ = FALSE;
		gchar** _tmp31_;
		gint _tmp31__length1;
		const gchar* _tmp32_;
		gboolean _tmp35_;
		gchar** _tmp39_;
		gint _tmp39__length1;
		const gchar* _tmp40_;
		gchar* _tmp41_;
		const gchar* _tmp42_;
		gchar _tmp43_ = '\0';
		gboolean _tmp44_ = FALSE;
		gchar** _tmp51_;
		gint _tmp51__length1;
		const gchar* _tmp52_;
		gchar* _tmp53_;
		const gchar* _tmp54_;
		gchar _tmp55_ = '\0';
		gboolean _tmp56_ = FALSE;
#line 42 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp20_ = range;
#line 42 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp21_ = g_str_has_prefix (_tmp20_, "bytes=");
#line 42 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		if (!_tmp21_) {
#line 559 "rygel-http-byte-seek.c"
			const gchar* _tmp22_ = NULL;
			const gchar* _tmp23_;
			GError* _tmp24_;
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp22_ = _ ("Invalid Range '%s'");
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp23_ = range;
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp24_ = g_error_new (RYGEL_HTTP_SEEK_ERROR, RYGEL_HTTP_SEEK_ERROR_INVALID_RANGE, _tmp22_, _tmp23_);
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_inner_error_ = _tmp24_;
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			if (_inner_error_->domain == RYGEL_HTTP_SEEK_ERROR) {
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				g_propagate_error (error, _inner_error_);
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_g_free0 (pos);
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_g_free0 (range);
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_g_object_unref0 (self);
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				return NULL;
#line 585 "rygel-http-byte-seek.c"
			} else {
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_g_free0 (pos);
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_g_free0 (range);
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				g_clear_error (&_inner_error_);
#line 43 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				return NULL;
#line 599 "rygel-http-byte-seek.c"
			}
		}
#line 47 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp25_ = range;
#line 47 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp26_ = string_substring (_tmp25_, (glong) 6, (glong) (-1));
#line 47 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp27_ = _tmp26_;
#line 47 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp29_ = _tmp28_ = g_strsplit (_tmp27_, "-", 2);
#line 47 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 47 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		range_tokens = _tmp29_;
#line 47 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		range_tokens_length1 = _vala_array_length (_tmp28_);
#line 47 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_range_tokens_size_ = range_tokens_length1;
#line 47 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_g_free0 (_tmp27_);
#line 48 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp31_ = range_tokens;
#line 48 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp31__length1 = range_tokens_length1;
#line 48 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp32_ = _tmp31_[0];
#line 48 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		if (_tmp32_ == NULL) {
#line 48 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp30_ = TRUE;
#line 630 "rygel-http-byte-seek.c"
		} else {
			gchar** _tmp33_;
			gint _tmp33__length1;
			const gchar* _tmp34_;
#line 48 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp33_ = range_tokens;
#line 48 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp33__length1 = range_tokens_length1;
#line 48 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp34_ = _tmp33_[1];
#line 48 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp30_ = _tmp34_ == NULL;
#line 643 "rygel-http-byte-seek.c"
		}
#line 48 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp35_ = _tmp30_;
#line 48 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		if (_tmp35_) {
#line 649 "rygel-http-byte-seek.c"
			const gchar* _tmp36_ = NULL;
			const gchar* _tmp37_;
			GError* _tmp38_;
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp36_ = _ ("Invalid Range '%s'");
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp37_ = range;
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp38_ = g_error_new (RYGEL_HTTP_SEEK_ERROR, RYGEL_HTTP_SEEK_ERROR_INVALID_RANGE, _tmp36_, _tmp37_);
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_inner_error_ = _tmp38_;
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			if (_inner_error_->domain == RYGEL_HTTP_SEEK_ERROR) {
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				g_propagate_error (error, _inner_error_);
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_g_free0 (pos);
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_g_free0 (range);
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_g_object_unref0 (self);
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				return NULL;
#line 675 "rygel-http-byte-seek.c"
			} else {
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_g_free0 (pos);
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_g_free0 (range);
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				g_clear_error (&_inner_error_);
#line 49 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				return NULL;
#line 689 "rygel-http-byte-seek.c"
			}
		}
#line 54 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp39_ = range_tokens;
#line 54 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp39__length1 = range_tokens_length1;
#line 54 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp40_ = _tmp39_[0];
#line 54 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp41_ = g_strdup (_tmp40_);
#line 54 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_g_free0 (pos);
#line 54 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		pos = _tmp41_;
#line 55 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp42_ = pos;
#line 55 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp43_ = string_get (_tmp42_, (glong) 0);
#line 55 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp44_ = g_ascii_isdigit (_tmp43_);
#line 55 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		if (_tmp44_) {
#line 712 "rygel-http-byte-seek.c"
			const gchar* _tmp45_;
			gint64 _tmp46_ = 0LL;
#line 56 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp45_ = pos;
#line 56 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp46_ = int64_parse (_tmp45_);
#line 56 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			start = _tmp46_;
#line 721 "rygel-http-byte-seek.c"
		} else {
			const gchar* _tmp47_;
#line 57 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp47_ = pos;
#line 57 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			if (g_strcmp0 (_tmp47_, "") != 0) {
#line 728 "rygel-http-byte-seek.c"
				const gchar* _tmp48_ = NULL;
				const gchar* _tmp49_;
				GError* _tmp50_;
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_tmp48_ = _ ("Invalid Range '%s'");
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_tmp49_ = range;
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_tmp50_ = g_error_new (RYGEL_HTTP_SEEK_ERROR, RYGEL_HTTP_SEEK_ERROR_INVALID_RANGE, _tmp48_, _tmp49_);
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_inner_error_ = _tmp50_;
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				if (_inner_error_->domain == RYGEL_HTTP_SEEK_ERROR) {
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					g_propagate_error (error, _inner_error_);
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_free0 (pos);
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_free0 (range);
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_object_unref0 (self);
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					return NULL;
#line 754 "rygel-http-byte-seek.c"
				} else {
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_free0 (pos);
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_free0 (range);
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					g_clear_error (&_inner_error_);
#line 58 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					return NULL;
#line 768 "rygel-http-byte-seek.c"
				}
			}
		}
#line 63 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp51_ = range_tokens;
#line 63 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp51__length1 = range_tokens_length1;
#line 63 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp52_ = _tmp51_[1];
#line 63 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp53_ = g_strdup (_tmp52_);
#line 63 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_g_free0 (pos);
#line 63 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		pos = _tmp53_;
#line 64 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp54_ = pos;
#line 64 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp55_ = string_get (_tmp54_, (glong) 0);
#line 64 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp56_ = g_ascii_isdigit (_tmp55_);
#line 64 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		if (_tmp56_) {
#line 792 "rygel-http-byte-seek.c"
			const gchar* _tmp57_;
			gint64 _tmp58_ = 0LL;
			gint64 _tmp59_;
			gint64 _tmp60_;
#line 65 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp57_ = pos;
#line 65 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp58_ = int64_parse (_tmp57_);
#line 65 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			stop = _tmp58_;
#line 66 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp59_ = stop;
#line 66 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp60_ = start;
#line 66 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			if (_tmp59_ < _tmp60_) {
#line 809 "rygel-http-byte-seek.c"
				const gchar* _tmp61_ = NULL;
				const gchar* _tmp62_;
				GError* _tmp63_;
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_tmp61_ = _ ("Invalid Range '%s'");
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_tmp62_ = range;
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_tmp63_ = g_error_new (RYGEL_HTTP_SEEK_ERROR, RYGEL_HTTP_SEEK_ERROR_INVALID_RANGE, _tmp61_, _tmp62_);
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_inner_error_ = _tmp63_;
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				if (_inner_error_->domain == RYGEL_HTTP_SEEK_ERROR) {
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					g_propagate_error (error, _inner_error_);
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_free0 (pos);
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_free0 (range);
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_object_unref0 (self);
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					return NULL;
#line 835 "rygel-http-byte-seek.c"
				} else {
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_free0 (pos);
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_free0 (range);
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					g_clear_error (&_inner_error_);
#line 67 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					return NULL;
#line 849 "rygel-http-byte-seek.c"
				}
			}
		} else {
			const gchar* _tmp64_;
#line 70 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp64_ = pos;
#line 70 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			if (g_strcmp0 (_tmp64_, "") != 0) {
#line 858 "rygel-http-byte-seek.c"
				const gchar* _tmp65_ = NULL;
				const gchar* _tmp66_;
				GError* _tmp67_;
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_tmp65_ = _ ("Invalid Range '%s'");
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_tmp66_ = range;
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_tmp67_ = g_error_new (RYGEL_HTTP_SEEK_ERROR, RYGEL_HTTP_SEEK_ERROR_INVALID_RANGE, _tmp65_, _tmp66_);
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				_inner_error_ = _tmp67_;
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
				if (_inner_error_->domain == RYGEL_HTTP_SEEK_ERROR) {
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					g_propagate_error (error, _inner_error_);
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_free0 (pos);
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_free0 (range);
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_object_unref0 (self);
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					return NULL;
#line 884 "rygel-http-byte-seek.c"
				} else {
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_free0 (pos);
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					_g_free0 (range);
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					g_clear_error (&_inner_error_);
#line 71 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
					return NULL;
#line 898 "rygel-http-byte-seek.c"
				}
			}
		}
	}
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp68_ = request;
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp69_ = _tmp68_->msg;
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp70_ = start;
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp71_ = stop;
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp72_ = total_length;
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	self = (RygelHTTPByteSeek*) rygel_http_seek_construct (object_type, _tmp69_, _tmp70_, _tmp71_, (gint64) 1, _tmp72_, &_inner_error_);
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	if (_inner_error_ != NULL) {
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		if (_inner_error_->domain == RYGEL_HTTP_SEEK_ERROR) {
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			g_propagate_error (error, _inner_error_);
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_g_free0 (pos);
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_g_free0 (range);
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_g_object_unref0 (self);
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			return NULL;
#line 931 "rygel-http-byte-seek.c"
		} else {
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_g_free0 (pos);
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_g_free0 (range);
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			g_clear_error (&_inner_error_);
#line 76 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			return NULL;
#line 945 "rygel-http-byte-seek.c"
		}
	}
#line 25 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	range_tokens = (_vala_array_free (range_tokens, range_tokens_length1, (GDestroyNotify) g_free), NULL);
#line 25 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_g_free0 (pos);
#line 25 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_g_free0 (range);
#line 25 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	return self;
#line 956 "rygel-http-byte-seek.c"
}


RygelHTTPByteSeek* rygel_http_byte_seek_new (RygelHTTPGet* request, GError** error) {
#line 25 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	return rygel_http_byte_seek_construct (RYGEL_TYPE_HTTP_BYTE_SEEK, request, error);
#line 963 "rygel-http-byte-seek.c"
}


gboolean rygel_http_byte_seek_needed (RygelHTTPGet* request) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	RygelHTTPGet* _tmp4_;
	RygelMediaItem* _tmp5_;
	gint64 _tmp6_;
	gboolean _tmp9_;
	gboolean _tmp17_;
	gboolean _tmp25_;
	gboolean _tmp30_;
#line 79 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	g_return_val_if_fail (request != NULL, FALSE);
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp4_ = request;
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp5_ = _tmp4_->item;
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp6_ = _tmp5_->size;
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	if (_tmp6_ > ((gint64) 0)) {
#line 990 "rygel-http-byte-seek.c"
		RygelHTTPGet* _tmp7_;
		RygelHTTPIdentityHandler* _tmp8_;
#line 81 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp7_ = request;
#line 81 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp8_ = _tmp7_->handler;
#line 81 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp3_ = RYGEL_IS_HTTP_IDENTITY_HANDLER (_tmp8_);
#line 999 "rygel-http-byte-seek.c"
	} else {
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp3_ = FALSE;
#line 1003 "rygel-http-byte-seek.c"
	}
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp9_ = _tmp3_;
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	if (_tmp9_) {
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp2_ = TRUE;
#line 1011 "rygel-http-byte-seek.c"
	} else {
		gboolean _tmp10_ = FALSE;
		RygelHTTPGet* _tmp11_;
		RygelThumbnail* _tmp12_;
		gboolean _tmp16_;
#line 82 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp11_ = request;
#line 82 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp12_ = _tmp11_->thumbnail;
#line 82 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		if (_tmp12_ != NULL) {
#line 1023 "rygel-http-byte-seek.c"
			RygelHTTPGet* _tmp13_;
			RygelThumbnail* _tmp14_;
			gint64 _tmp15_;
#line 83 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp13_ = request;
#line 83 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp14_ = _tmp13_->thumbnail;
#line 83 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp15_ = _tmp14_->size;
#line 83 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp10_ = _tmp15_ > ((gint64) 0);
#line 1035 "rygel-http-byte-seek.c"
		} else {
#line 82 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp10_ = FALSE;
#line 1039 "rygel-http-byte-seek.c"
		}
#line 82 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp16_ = _tmp10_;
#line 82 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp2_ = _tmp16_;
#line 1045 "rygel-http-byte-seek.c"
	}
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp17_ = _tmp2_;
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	if (_tmp17_) {
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp1_ = TRUE;
#line 1053 "rygel-http-byte-seek.c"
	} else {
		gboolean _tmp18_ = FALSE;
		RygelHTTPGet* _tmp19_;
		RygelSubtitle* _tmp20_;
		gboolean _tmp24_;
#line 84 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp19_ = request;
#line 84 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp20_ = _tmp19_->subtitle;
#line 84 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		if (_tmp20_ != NULL) {
#line 1065 "rygel-http-byte-seek.c"
			RygelHTTPGet* _tmp21_;
			RygelSubtitle* _tmp22_;
			gint64 _tmp23_;
#line 84 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp21_ = request;
#line 84 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp22_ = _tmp21_->subtitle;
#line 84 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp23_ = _tmp22_->size;
#line 84 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp18_ = _tmp23_ > ((gint64) 0);
#line 1077 "rygel-http-byte-seek.c"
		} else {
#line 84 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
			_tmp18_ = FALSE;
#line 1081 "rygel-http-byte-seek.c"
		}
#line 84 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp24_ = _tmp18_;
#line 84 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp1_ = _tmp24_;
#line 1087 "rygel-http-byte-seek.c"
	}
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp25_ = _tmp1_;
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	if (_tmp25_) {
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp0_ = TRUE;
#line 1095 "rygel-http-byte-seek.c"
	} else {
		RygelHTTPGet* _tmp26_;
		SoupMessage* _tmp27_;
		SoupMessageHeaders* _tmp28_;
		const gchar* _tmp29_ = NULL;
#line 85 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp26_ = request;
#line 85 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp27_ = _tmp26_->msg;
#line 85 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp28_ = _tmp27_->request_headers;
#line 85 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp29_ = soup_message_headers_get_one (_tmp28_, "User-Agent");
#line 85 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp0_ = g_strcmp0 (_tmp29_, "PLAYSTATION 3") == 0;
#line 1111 "rygel-http-byte-seek.c"
	}
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp30_ = _tmp0_;
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	result = _tmp30_;
#line 80 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	return result;
#line 1119 "rygel-http-byte-seek.c"
}


gboolean rygel_http_byte_seek_requested (RygelHTTPGet* request) {
	gboolean result = FALSE;
	RygelHTTPGet* _tmp0_;
	SoupMessage* _tmp1_;
	SoupMessageHeaders* _tmp2_;
	const gchar* _tmp3_ = NULL;
#line 89 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	g_return_val_if_fail (request != NULL, FALSE);
#line 90 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp0_ = request;
#line 90 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp1_ = _tmp0_->msg;
#line 90 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp2_ = _tmp1_->request_headers;
#line 90 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp3_ = soup_message_headers_get_one (_tmp2_, "Range");
#line 90 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	result = _tmp3_ != NULL;
#line 90 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	return result;
#line 1143 "rygel-http-byte-seek.c"
}


static void rygel_http_byte_seek_real_add_response_headers (RygelHTTPSeek* base) {
	RygelHTTPByteSeek * self;
	gchar* _tmp0_;
	gchar* range;
	SoupMessage* _tmp1_;
	SoupMessage* _tmp2_;
	SoupMessageHeaders* _tmp3_;
	SoupMessageHeaders* headers;
	SoupMessage* _tmp4_;
	SoupMessage* _tmp5_;
	SoupMessageHeaders* _tmp6_;
	const gchar* _tmp7_ = NULL;
	SoupMessageHeaders* _tmp33_;
	gint64 _tmp34_;
	gint64 _tmp35_;
#line 93 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	self = (RygelHTTPByteSeek*) base;
#line 95 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp0_ = g_strdup ("bytes ");
#line 95 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	range = _tmp0_;
#line 96 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp1_ = rygel_http_seek_get_msg ((RygelHTTPSeek*) self);
#line 96 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp2_ = _tmp1_;
#line 96 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp3_ = _tmp2_->response_headers;
#line 96 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	headers = _tmp3_;
#line 98 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp4_ = rygel_http_seek_get_msg ((RygelHTTPSeek*) self);
#line 98 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp5_ = _tmp4_;
#line 98 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp6_ = _tmp5_->request_headers;
#line 98 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp7_ = soup_message_headers_get_one (_tmp6_, "Range");
#line 98 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	if (_tmp7_ != NULL) {
#line 1186 "rygel-http-byte-seek.c"
		SoupMessageHeaders* _tmp8_;
		const gchar* _tmp9_;
		gint64 _tmp10_;
		gint64 _tmp11_;
		gchar* _tmp12_ = NULL;
		gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		gint64 _tmp16_;
		gint64 _tmp17_;
		gchar* _tmp18_ = NULL;
		gchar* _tmp19_;
		gchar* _tmp20_;
		gchar* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		gint64 _tmp24_;
		gint64 _tmp25_;
		gchar* _tmp26_ = NULL;
		gchar* _tmp27_;
		gchar* _tmp28_;
		gchar* _tmp29_;
		gchar* _tmp30_;
		SoupMessageHeaders* _tmp31_;
		const gchar* _tmp32_;
#line 99 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp8_ = headers;
#line 99 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		soup_message_headers_append (_tmp8_, "Accept-Ranges", "bytes");
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp9_ = range;
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp10_ = rygel_http_seek_get_start ((RygelHTTPSeek*) self);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp11_ = _tmp10_;
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp12_ = g_strdup_printf ("%" G_GINT64_FORMAT, _tmp11_);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp13_ = _tmp12_;
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp14_ = g_strconcat (_tmp13_, "-", NULL);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp15_ = _tmp14_;
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp16_ = rygel_http_seek_get_stop ((RygelHTTPSeek*) self);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp17_ = _tmp16_;
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp18_ = g_strdup_printf ("%" G_GINT64_FORMAT, _tmp17_);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp19_ = _tmp18_;
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp20_ = g_strconcat (_tmp15_, _tmp19_, NULL);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp21_ = _tmp20_;
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp22_ = g_strconcat (_tmp21_, "/", NULL);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp23_ = _tmp22_;
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp24_ = rygel_http_seek_get_total_length ((RygelHTTPSeek*) self);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp25_ = _tmp24_;
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp26_ = g_strdup_printf ("%" G_GINT64_FORMAT, _tmp25_);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp27_ = _tmp26_;
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp28_ = g_strconcat (_tmp23_, _tmp27_, NULL);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp29_ = _tmp28_;
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp30_ = g_strconcat (_tmp9_, _tmp29_, NULL);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_g_free0 (range);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		range = _tmp30_;
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_g_free0 (_tmp29_);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_g_free0 (_tmp27_);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_g_free0 (_tmp23_);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_g_free0 (_tmp21_);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_g_free0 (_tmp19_);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_g_free0 (_tmp15_);
#line 101 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_g_free0 (_tmp13_);
#line 104 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp31_ = headers;
#line 104 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		_tmp32_ = range;
#line 104 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
		soup_message_headers_append (_tmp31_, "Content-Range", _tmp32_);
#line 1284 "rygel-http-byte-seek.c"
	}
#line 107 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp33_ = headers;
#line 107 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp34_ = rygel_http_seek_get_length ((RygelHTTPSeek*) self);
#line 107 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_tmp35_ = _tmp34_;
#line 107 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	soup_message_headers_set_content_length (_tmp33_, _tmp35_);
#line 93 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	_g_free0 (range);
#line 1296 "rygel-http-byte-seek.c"
}


static void rygel_http_byte_seek_class_init (RygelHTTPByteSeekClass * klass) {
#line 24 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	rygel_http_byte_seek_parent_class = g_type_class_peek_parent (klass);
#line 24 "/home/jens/Source/rygel/tests/rygel-http-byte-seek.vala"
	RYGEL_HTTP_SEEK_CLASS (klass)->add_response_headers = rygel_http_byte_seek_real_add_response_headers;
#line 1305 "rygel-http-byte-seek.c"
}


static void rygel_http_byte_seek_instance_init (RygelHTTPByteSeek * self) {
}


GType rygel_http_byte_seek_get_type (void) {
	static volatile gsize rygel_http_byte_seek_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_http_byte_seek_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelHTTPByteSeekClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_http_byte_seek_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelHTTPByteSeek), 0, (GInstanceInitFunc) rygel_http_byte_seek_instance_init, NULL };
		GType rygel_http_byte_seek_type_id;
		rygel_http_byte_seek_type_id = g_type_register_static (RYGEL_TYPE_HTTP_SEEK, "RygelHTTPByteSeek", &g_define_type_info, 0);
		g_once_init_leave (&rygel_http_byte_seek_type_id__volatile, rygel_http_byte_seek_type_id);
	}
	return rygel_http_byte_seek_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



