GNOME Bugzilla – Bug 595901
totem-pl-parser failed to add urls which is not supported by gvfs
Last modified: 2009-09-25 20:43:46 UTC
I wrote a plugin which named totem-pps[1] for totem. It's a PPStream[2](it's a chinese content provider) browser plugin. The plugin itself works well on totem 2.28 but the lastest totem silently ignores play requests. So, users can't play videos any more. Uri shemes used by ppstream are tvod:// and pps://, for example: tvod://3eca151e2e516fe8e7331f922850dc6899979a52e09cb7a2c24463019e41fd37f277c53a6bff0934ab77a3eaf4b3690a/090921-大学生了没.rm pps://hwjxehoqeb5ymigt2aqa.pps/csi纽约第2季-01.wmv I found the problem is in totem_pl_parser_parse_internal() in file plparse/totem-pl-parser.c from line 1875: for (i = 0; i < G_N_ELEMENTS(dual_types) && found == FALSE; i++) { if (strcmp (dual_types[i].mimetype, mimetype) == 0) { DEBUG(file, g_print ("URI '%s' is dual type '%s'\n", uri, mimetype)); if (data == NULL) { g_free (mimetype); mimetype = my_g_file_info_get_mime_type_with_data (file, &data, parser); DEBUG(file, g_print ("URI '%s' dual type has type '%s' from data\n", uri, mimetype)); ^^ mimetype is NULL, since tvod:// is not supported by gvfs. } /* If it's _still_ a text/plain, we don't want it */ if (mimetype == NULL || strcmp (mimetype, "text/plain") == 0) { ret = TOTEM_PL_PARSER_RESULT_IGNORED; g_free (mimetype); mimetype = NULL; break; ^^ tvod:// uris got ignored. } So, the totem_pl_parser_parse_internal() ignores uri, since it can't figure out it'a playlist or not, and then totem refuse to play any uri which is not supported by gvfs. Should totem_pl_parser_parse_internal() check the uri is supported by gvfs first? if it is, then try to find mimetype from its content, else just use mimetype returned by g_content_type_guess(). [1]http://cgit.freedesktop.org/~jinghua/totem-pps [2]http://kan.pps.tv
Created attachment 143915 [details] [review] A fix works for me I attached a patch which works for me. Please review it.
Fixed in a different way in totem-pl-parser. Too many false positives with the fix for bug 584312. commit 1c6dc284ba809ccd398c35bb20654da16ab39520 Author: Bastien Nocera <hadess@hadess.net> Date: Thu Sep 24 19:31:39 2009 +0100 Only ever ignore files that we can discover as text/plain Otherwise we'd be ignoring files for which we don't have magic, which seems to happen a lot for MPEG-4 files, and their ever-growing ftypes.
*** Bug 595822 has been marked as a duplicate of this bug. ***