1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
6 * Moonlight List (moonlight-list@lists.ximian.com)
8 * Copyright 2008 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
18 #include "http-streaming.h"
22 static const char * features
[] = {"broadcast", "last", "live", "playlist", "reliable", "seekable", "skipbackwards", "skipforward", "stridable", NULL
};
25 parse_http_streaming_features (const char *val
)
27 HttpStreamingFeatures result
= HttpStreamingFeaturesNone
;
31 LOG_HTTPSTREAMING ("parse_http_streaming_features ('%s')\n", val
);
40 end
= (val
[length
] == 0 || val
[length
] == '"');
41 if (end
|| val
[length
] == ',') {
43 //printf ("Checking feature: '%.*s'\n", length, val + start);
45 for (int i
= 0; features
[i
] != NULL
; i
++) {
46 if (length
!= strlen (features
[i
]))
49 if (strncmp (val
, features
[i
], length
) == 0) {
50 result
= (HttpStreamingFeatures
) (result
| (1 << i
));
54 //printf ("Features: '%i'\n", results);