hrkfdn / mpdas

MPD AudioScrobbler written in C++ using libcurl
http://50hz.ws/mpdas/
Other
125 stars 22 forks source link

Allow scrobbling from internet radio streams #21

Open christopher-fu opened 9 years ago

christopher-fu commented 9 years ago

Oone feature that would be pretty cool would be the ability to scrobble tracks from internet radio streams. Right now mpdas only pulls metadata from the ID3 tags associated with the music file using libmpdclient, but there is no such data associated with a stream url. Instead, mpd picks up that data as it streams music from the url. If the currently playing song's title provided by the stream is well-formed (i.e., in the format "Artist - Song Title"), we can parse that and use that to scrobble the song.

troxor commented 8 years ago

This is great. Thank you!

troxor commented 8 years ago

After running for a while, I noticed some memory leakage...

==29704== LEAK SUMMARY:
==29704==    definitely lost: 25,441,600 bytes in 79,505 blocks
==29704==    indirectly lost: 13,475,549 bytes in 238,477 blocks
==29704==      possibly lost: 29,958 bytes in 259 blocks
==29704==    still reachable: 2,930 bytes in 38 blocks
==29704==         suppressed: 0 bytes in 0 blocks

I'll keep investigating this unless someone else beats me to it.

christopher-fu commented 8 years ago

I believe 10a4b0f fixes the memory leak.

troxor commented 8 years ago

Indeed it does! However, this PR reintroduces the leak. Moving mpd_song_free(song); on mpd.cpp:133 down a couple lines to the same scope as mpd_song *song = mpd_run_current_song(_conn); will clear it up. At least, it worked for me.

christopher-fu commented 8 years ago

The last merge should have included the fix.

f1u77y commented 8 years ago

What's status of this PR? valgrind does output many errors and reports memory leaks for me. I've fixed radio streams scrobbling in another way(https://github.com/f1u77y/mpdas/commits/handle-streams) when I didn't know about this. Should I make another PR on this or wait for merging this one?

christopher-fu commented 8 years ago

You should definitely submit another PR. I wrote this a while back to solve a problem I had with a certain internet radio stream, and it might not (probably won't?) work for your use case. I also haven't looked closely at any memory leaks other than merging any fixes into my fork.

YuyQuan commented 6 years ago

I'm having issues with this. Here is a screenshot me listening to a local file and then internet radio. The local file goes through but not the song "DOT.EXE - :delta"

screen shot 2018-09-05 at 6 33 33 pm

my .mpdasrc is just my username and password.