gxine open from "Edit playlist" fails

Bug #33493 reported by Geoff Jacobsen
8
Affects Status Importance Assigned to Milestone
gxine
Fix Released
Medium
Darren Salt
gxine (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

If the "open" option is used from within the "Edit playlist" and then use the "open" button to add a file to the playlist you get an error like the following:

  'somefile.mov' is not a valid XML/ASX file

If you drag the file to the playlist all is fine (as is selecting "open" from the "file" menu).

Note: gxine also attempts to read the entire file into memory such that if you say try to open a large vob file it can eat up all your physical memory.

Revision history for this message
Darren Salt (dsalt) wrote :

That icon's for playlist files, not audio or video files, and you should be using the "new" icon for a/v.

However, you've successfully shown that there's some UI suckage here, and you /may/ have delayed the release of 0.5.5 a little - if so, well done ;-)

Changed in gxine:
assignee: nobody → linux-youmustbejoking
status: Unconfirmed → Confirmed
assignee: linux-youmustbejoking → nobody
Darren Salt (dsalt)
Changed in gxine:
assignee: nobody → linux-youmustbejoking
Revision history for this message
Darren Salt (dsalt) wrote : Re: [Bug 33493] gxine open from "Edit playlist" fails

I've fixed the file-slurping behaviour in CVS HEAD. The attached patch works
for 0.5.1.

--
| Darren Salt | linux or ds at | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Buy less and make it last longer. INDUSTRY CAUSES GLOBAL WARMING.

You will spend the rest of your life in the future.

--- gxine-0.5.1/src/playlist.c.orig 2006-03-04 20:17:26.000000000 +0000
+++ gxine-0.5.1/src/playlist.c 2006-03-04 20:17:51.000000000 +0000
@@ -287,18 +287,29 @@

 static int playlist_load (char *fname)
 {
- char *plfile;
+ char *plfile = NULL;
+ struct stat st;
   xml_node_t *node;
   gboolean defaultfile = !fname;

   if (!fname)
     fname = g_strconcat(g_get_home_dir(), "/.gxine/playlist", NULL);

- plfile = read_entire_file (fname, NULL);
+ if (!stat (fname, &st))
+ {
+ if (S_ISDIR (st.st_mode))
+ errno = EISDIR;
+ else if (!S_ISREG (st.st_mode))
+ errno = ENOENT;
+ else if (st.st_size > 4*1024*1024)
+ errno = EFBIG;
+ else
+ plfile = read_entire_file (fname, NULL);
+ }

   if (!plfile)
   {
- if (errno != ENOENT && (defaultfile && errno != ENOTDIR))
+ if (errno != ENOENT && (defaultfile || errno != ENOTDIR))
       display_error (FROM_GXINE, _("Loading of playlist file failed."),
        _("Failed to open file '%s'\n%s"), fname, strerror (errno));
     goto ret0;

Darren Salt (dsalt)
Changed in gxine:
status: Unconfirmed → Fix Committed
Revision history for this message
Reinhard Tartler (siretart) wrote :

gxine (0.5.1-0ubuntu5) dapper; urgency=low

  * Bugfix: gxine open from "Edit playlist" fails" - thanks for the patch to
    Darren Salt, (Closes: Malone #349618)

 -- Reinhard Tartler <email address hidden> Sun, 5 Mar 2006 23:25:43 +0100

Changed in gxine:
status: Confirmed → Fix Released
Revision history for this message
dino99 (9d9) wrote :

outdated

Changed in gxine:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.