#190 MPD: add mpd_date function that shows date for current track

Andrey Tikhonov

Everything is shown is the summary. I include two patches - for version 1.8.1 that works perfectly for me and for version from git which fails with segmentation fault, ne


  • Patch for git version

  • Patch for version 1.8.1

  • pavelo

    1. Could you include a patch for the documentation as well?

    2. Could you try to fix the master segfault? Or at least give me your thoughts on why it crashes? The patch seems quite simple. Does the unpatched version work correctly? I'd hate to have a feature in 1.8.* and then remove it in 2.*.


  • 1. Sure, I'll update the patch as fast as possible.

    2. I'll try to fix up the crash, but it may take some time. It crashes in the unpatched version as well, otherwise I wouldn't have submitted a patch that makes a working program crash ;)

  • Patch for the documentation for version 1.8.1

  • Crash happens in mpd.cc at lines 263-268 when any of song->{artist,album,title,track,name,file} is NULL. You try to assign a null-pointer string to another string and it causes segmentation fault. I'll make a patch soon.

  • I've fixed the issue, but now no mpd-related strings are printed at all.

  • Patch for git version #2, documentation included

  • Finally I've made it work. The problem was that in mpd_cb::work internal there was a local variable for results, and actual results were not changed at all, because they are stored in another variable, the fix is one line: put contents of local variable into global one, see the comment.

  • pavelo

    woops, that was embarrasing.

    thanks for fixing this. I have included the patch in the git repo.

  • pavelo

    • status: open --> closed-accepted