PlayerThread: allocate decoder_control on the stack
This commit is contained in:
parent
96b70835f9
commit
92a93c1217
@ -1107,8 +1107,8 @@ player_task(gpointer arg)
|
|||||||
{
|
{
|
||||||
struct player_control *pc = (struct player_control *)arg;
|
struct player_control *pc = (struct player_control *)arg;
|
||||||
|
|
||||||
struct decoder_control *dc = new decoder_control();
|
decoder_control dc;
|
||||||
decoder_thread_start(dc);
|
decoder_thread_start(&dc);
|
||||||
|
|
||||||
MusicBuffer buffer(pc->buffer_chunks);
|
MusicBuffer buffer(pc->buffer_chunks);
|
||||||
|
|
||||||
@ -1120,7 +1120,7 @@ player_task(gpointer arg)
|
|||||||
case PLAYER_COMMAND_QUEUE:
|
case PLAYER_COMMAND_QUEUE:
|
||||||
assert(pc->next_song != NULL);
|
assert(pc->next_song != NULL);
|
||||||
|
|
||||||
do_play(pc, dc, buffer);
|
do_play(pc, &dc, buffer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_COMMAND_STOP:
|
case PLAYER_COMMAND_STOP:
|
||||||
@ -1161,8 +1161,8 @@ player_task(gpointer arg)
|
|||||||
case PLAYER_COMMAND_EXIT:
|
case PLAYER_COMMAND_EXIT:
|
||||||
pc->Unlock();
|
pc->Unlock();
|
||||||
|
|
||||||
dc->Quit();
|
dc.Quit();
|
||||||
delete dc;
|
|
||||||
audio_output_all_close();
|
audio_output_all_close();
|
||||||
|
|
||||||
player_command_finished(pc);
|
player_command_finished(pc);
|
||||||
|
Loading…
Reference in New Issue
Block a user