Author: lisu                         Date: Tue Apr  6 12:05:11 2010 GMT
Module: packages                      Tag: DEVEL
---- Log message:
- fix MPD_PLAYLIST_LOAD_FAILED problem

---- Files affected:
packages/libmpd:
   libmpd-playlist.patch (NONE -> 1.1.2.1)  (NEW)

---- Diffs:

================================================================
Index: packages/libmpd/libmpd-playlist.patch
diff -u /dev/null packages/libmpd/libmpd-playlist.patch:1.1.2.1
--- /dev/null   Tue Apr  6 14:05:11 2010
+++ packages/libmpd/libmpd-playlist.patch       Tue Apr  6 14:05:06 2010
@@ -0,0 +1,78 @@
+--- a/src/libmpd-playlist.c
++++ b/src/libmpd-playlist.c
+@@ -588,6 +588,9 @@ int mpd_playlist_queue_commit(MpdObj *mi)
+       }
+       mpd_sendCommandListEnd(mi->connection);
+       mpd_finishCommand(mi->connection);
++
++    
++    
+       mpd_unlock_conn(mi);
+       mpd_status_update(mi);
+       return MPD_OK;
+@@ -765,3 +768,34 @@ MpdData * mpd_playlist_search_commit(MpdObj *mi)
+       return mpd_data_get_first(data);
+ }
+ 
++
++int mpd_playlist_load(MpdObj *mi, const char *path)
++{
++    int retv = MPD_OK;
++      if(!mpd_check_connected(mi))
++      {
++              debug_printf(DEBUG_WARNING,"mpd_playlist_load: not 
connected\n");
++              return MPD_NOT_CONNECTED;
++      }
++      if(mpd_lock_conn(mi))
++      {
++              debug_printf(DEBUG_ERROR,"lock failed\n");
++              return NULL;
++      }
++    mpd_sendLoadCommand(mi->connection,path);
++      mpd_finishCommand(mi->connection);
++    printf("mi->connection->errorCode: %i\n", mi->connection->errorCode);
++    if(mi->connection->errorCode == MPD_ACK_ERROR_NO_EXIST) 
++    {
++        debug_printf(DEBUG_WARNING, "mpd_playlist_load: failed to load 
playlist\n");
++              mpd_clearError(mi->connection);
++        retv = MPD_PLAYLIST_LOAD_FAILED;
++    }
++
++      if(mpd_unlock_conn(mi))
++      {
++              debug_printf(DEBUG_ERROR, "Failed to unlock connection");
++              return MPD_LOCK_FAILED;
++      }
++    return retv;
++}
+--- a/src/libmpd-playlist.h
++++ b/src/libmpd-playlist.h
+@@ -341,6 +341,15 @@ int mpd_playlist_mpd_queue_add(MpdObj *mi, int songid);
+  */
+ int mpd_playlist_mpd_queue_remove(MpdObj *mi, int songpos);
+ 
++/**
++ * @param mi a #MpdObj
++ * @param path The path to a playlist to load
++ *
++ * This queues a load command. The actual load isn't done until 
#mpd_playlist_queue_commit is called
++ *
++ * @returns a #MpdError
++ */
++int   mpd_playlist_load               (MpdObj *mi,const char *path);
+ /*...@}*/
+ 
+ #endif
+--- a/src/libmpd.h
++++ b/src/libmpd.h
+@@ -84,6 +84,9 @@ typedef enum {
+ 
+       /** Tag Item not found */
+       MPD_TAG_NOT_FOUND = -90,
++
++    /* MPD_PLALIST_LOAD_FAILED */
++    MPD_PLAYLIST_LOAD_FAILED = -100,
+       
+       /** Fatal error, something I am not sure what todo with */
+       MPD_FATAL_ERROR = -1000
+
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to