playlist/asx: make variables more local

This commit is contained in:
Max Kellermann 2014-01-09 12:18:13 +01:00
parent 322b061632
commit dab052e53d

View File

@ -182,21 +182,20 @@ static SongEnumerator *
asx_open_stream(InputStream &is) asx_open_stream(InputStream &is)
{ {
AsxParser parser; AsxParser parser;
GMarkupParseContext *context;
char buffer[1024];
size_t nbytes;
bool success; bool success;
Error error2; Error error2;
GError *error = nullptr; GError *error = nullptr;
/* parse the ASX XML file */ /* parse the ASX XML file */
context = g_markup_parse_context_new(&asx_parser, GMarkupParseContext *context =
G_MARKUP_TREAT_CDATA_AS_TEXT, g_markup_parse_context_new(&asx_parser,
&parser, nullptr); G_MARKUP_TREAT_CDATA_AS_TEXT,
&parser, nullptr);
while (true) { while (true) {
nbytes = is.LockRead(buffer, sizeof(buffer), error2); char buffer[1024];
size_t nbytes = is.LockRead(buffer, sizeof(buffer), error2);
if (nbytes == 0) { if (nbytes == 0) {
if (error2.IsDefined()) { if (error2.IsDefined()) {
g_markup_parse_context_free(context); g_markup_parse_context_free(context);