aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wittig <michael.wittig@fu-berlin.de>2010-10-14 14:40:07 +0200
committerMichael Wittig <michael.wittig@fu-berlin.de>2010-10-14 14:40:07 +0200
commit083502684be81b8bff4460ccadf3a903290949a0 (patch)
treeb04cae12e12529558a16a30c83a2514e3c24ac28
parentc840d5e566dfe3d1c24e183ba558e02a7075a36d (diff)
downloaderlang-083502684be81b8bff4460ccadf3a903290949a0.tar.gz
erlang-083502684be81b8bff4460ccadf3a903290949a0.tar.xz
erlang-083502684be81b8bff4460ccadf3a903290949a0.zip
search_best
-rw-r--r--server/media.erl9
1 files changed, 1 insertions, 8 deletions
diff --git a/server/media.erl b/server/media.erl
index d20c8e9..f5f4770 100644
--- a/server/media.erl
+++ b/server/media.erl
@@ -91,14 +91,7 @@ play(Artist, Title, Callback) ->
[Head|_] = ask(Artist, Title),
{_, Title, Artist, _, _, Fp} = Head,
Port = erlang:open_port({spawn_executable, "/usr/bin/mplayer"}, [{args, [Fp]}, exit_status]),
-
- % lock the song
- F = fun() ->
- New = Head#track{locked = 1},
- mnesia:write(New)
- end,
- mnesia:transaction(F),
-
+ spawn(media, lock_process,[Artist,Title]),
io:format("playing: ~s, Artist: ~s~n", [Title, Artist]),
receive
{Port, {exit_status, 0}} -> start_playing();