After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 595901 - totem-pl-parser failed to add urls which is not supported by gvfs
totem-pl-parser failed to add urls which is not supported by gvfs
Status: RESOLVED FIXED
Product: totem-pl-parser
Classification: Core
Component: General
2.28.x
Other Linux
: Normal normal
: ---
Assigned To: totem-pl-parser-maint
totem-pl-parser-maint
: 595822 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-09-22 04:19 UTC by sunmoon1997
Modified: 2009-09-25 20:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A fix works for me (1.53 KB, patch)
2009-09-24 14:53 UTC, sunmoon1997
none Details | Review

Description sunmoon1997 2009-09-22 04:19:44 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
Comment 1 sunmoon1997 2009-09-24 14:53:25 UTC
Created attachment 143915 [details] [review]
A fix works for me

I attached a patch which works for me. Please review it.
Comment 2 Bastien Nocera 2009-09-24 18:38:09 UTC
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.
Comment 3 Philip Withnall 2009-09-25 20:43:46 UTC
*** Bug 595822 has been marked as a duplicate of this bug. ***