[totem/gnome-2-32] playlist: Fix "disappearing" entries
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/gnome-2-32] playlist: Fix "disappearing" entries
- Date: Mon, 21 Feb 2011 05:57:11 +0000 (UTC)
commit a76d441c5807f938b95249ea0a97f1523c3b9d12
Author: Bastien Nocera <hadess hadess net>
Date: Mon Feb 21 00:30:52 2011 +0000
playlist: Fix "disappearing" entries
When processing out-of-order playlist entries, make sure to use
their own parsing results.
If we don't do that, we might be using an error result, or an
unhandled result as a success because the earlier item we just parsed
was such a success.
This can be reproduced using mixed types of media over a slow link, eg.
"dual-types" files such as MP4, and "unhandled" types such as AVI over
SMB.
src/totem-playlist.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/totem-playlist.c b/src/totem-playlist.c
index 0812b6f..66b429d 100644
--- a/src/totem-playlist.c
+++ b/src/totem-playlist.c
@@ -1978,6 +1978,7 @@ add_mrls_operation_data_free (AddMrlsOperationData *data)
struct TotemPlaylistMrlData {
gchar *mrl;
gchar *display_name;
+ TotemPlParserResult res;
/* Implementation details */
AddMrlsOperationData *operation_data;
@@ -2060,11 +2061,10 @@ add_mrls_finish_operation (AddMrlsOperationData *operation_data)
static void
add_mrls_cb (TotemPlParser *parser, GAsyncResult *result, TotemPlaylistMrlData *mrl_data)
{
- TotemPlParserResult res;
AddMrlsOperationData *operation_data = mrl_data->operation_data;
/* Finish parsing the playlist */
- res = totem_pl_parser_parse_finish (parser, result, NULL);
+ mrl_data->res = totem_pl_parser_parse_finish (parser, result, NULL);
g_assert (mrl_data->index >= operation_data->next_index_to_add);
@@ -2073,7 +2073,7 @@ add_mrls_cb (TotemPlParser *parser, GAsyncResult *result, TotemPlaylistMrlData *
/* The entry is the next one in the order, so doesn't need to be added to the unadded list, and can be added to playlist proper */
operation_data->next_index_to_add++;
- handle_parse_result (res, operation_data->playlist, mrl_data->mrl, mrl_data->display_name);
+ handle_parse_result (mrl_data->res, operation_data->playlist, mrl_data->mrl, mrl_data->display_name);
/* See if we can now add any other entries which have already been processed */
for (i = operation_data->unadded_entries;
@@ -2082,7 +2082,7 @@ add_mrls_cb (TotemPlParser *parser, GAsyncResult *result, TotemPlaylistMrlData *
TotemPlaylistMrlData *_mrl_data = (TotemPlaylistMrlData*) i->data;
operation_data->next_index_to_add++;
- handle_parse_result (res, operation_data->playlist, _mrl_data->mrl, _mrl_data->display_name);
+ handle_parse_result (_mrl_data->res, operation_data->playlist, _mrl_data->mrl, _mrl_data->display_name);
}
operation_data->unadded_entries = i;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]