raspi: improve set_volume

This commit is contained in:
Stefan Seyfried
2013-10-21 00:21:56 +02:00
parent e0f5184900
commit a78e983d5f
2 changed files with 4 additions and 8 deletions

View File

@@ -96,9 +96,9 @@ next_packet:
pthread_mutex_unlock(&pi->omx_active_mutex);
goto next_packet;
} else if (current->msgtype == MSG_SET_VOLUME) {
fprintf(stderr, "[acodec] SET_VOLUME %lld\n", current->data->PTS);
omx_audio_volume(&pi->audio_render, current->data->PTS);
codec_queue_free_item(codec,current);
fprintf(stderr, "[acodec] SET_VOLUME %ld\n", (long)current->data);
omx_audio_volume(&pi->audio_render, (long)current->data);
free(current);
pthread_mutex_unlock(&pi->omx_active_mutex);
goto next_packet;
}

View File

@@ -414,12 +414,8 @@ void aDec::run()
int aDec::set_volume(int vol)
{
struct packet_t *packet;
long volume = (vol - 100) * 60;
packet = (packet_t *)malloc(sizeof(*packet));
packet->PTS = volume;
packet->buf = NULL;
codec_queue_add_item(&codecs.acodec, packet, MSG_SET_VOLUME);
codec_send_message(&codecs.acodec, MSG_SET_VOLUME, (void *)volume);
return 0;
}