mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 07:23:11 +02:00
raspi: improve set_volume
This commit is contained in:
@@ -96,9 +96,9 @@ next_packet:
|
|||||||
pthread_mutex_unlock(&pi->omx_active_mutex);
|
pthread_mutex_unlock(&pi->omx_active_mutex);
|
||||||
goto next_packet;
|
goto next_packet;
|
||||||
} else if (current->msgtype == MSG_SET_VOLUME) {
|
} else if (current->msgtype == MSG_SET_VOLUME) {
|
||||||
fprintf(stderr, "[acodec] SET_VOLUME %lld\n", current->data->PTS);
|
fprintf(stderr, "[acodec] SET_VOLUME %ld\n", (long)current->data);
|
||||||
omx_audio_volume(&pi->audio_render, current->data->PTS);
|
omx_audio_volume(&pi->audio_render, (long)current->data);
|
||||||
codec_queue_free_item(codec,current);
|
free(current);
|
||||||
pthread_mutex_unlock(&pi->omx_active_mutex);
|
pthread_mutex_unlock(&pi->omx_active_mutex);
|
||||||
goto next_packet;
|
goto next_packet;
|
||||||
}
|
}
|
||||||
|
@@ -414,12 +414,8 @@ void aDec::run()
|
|||||||
|
|
||||||
int aDec::set_volume(int vol)
|
int aDec::set_volume(int vol)
|
||||||
{
|
{
|
||||||
struct packet_t *packet;
|
|
||||||
long volume = (vol - 100) * 60;
|
long volume = (vol - 100) * 60;
|
||||||
packet = (packet_t *)malloc(sizeof(*packet));
|
codec_send_message(&codecs.acodec, MSG_SET_VOLUME, (void *)volume);
|
||||||
packet->PTS = volume;
|
|
||||||
packet->buf = NULL;
|
|
||||||
codec_queue_add_item(&codecs.acodec, packet, MSG_SET_VOLUME);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user