Removing sources that are at the end of the Sink

Abierto
#636 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
rust

Línea de trabajo

Start by reading the sink and source APIs described in the issue, especially how appended sources are queued and how EmptyCallback runs when a source ends. Explore whether the API supports removing a queued source while the current one plays without disrupting gapless playback. Done means the next source can be replaced during playback without stutters or silence; the issue names no files or tests to run.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Hi there!

I just had a brief issue dealing with the following situation:

  1. You create a new sink.
  2. You open two sources from files.
  3. Both sources are appended to the sink
  4. During playback of source 1, you decide that you want to remove source 2, and append a new source in its place.

However, I want to do this without interrupting the flow of playback. This is for a music player, so the possibility of the next upcoming song changing (say, because of a queue change) without interrupting the current playback (stutters, moment of silence, etc) is quite important. I would also like to keep the gapless playback functionality.

Right now, the only solution I could think of is having a secondary sink which is switched out, but this seems a bit cumbersome and likely to cause one of the issues I mentioned above. The way my player works right now is there is a Vec of song file paths (my 'lightweight' queue). When you add a song to this file path queue, it checks to see if the sink contains < 4 song sources in it. If it does, then it opens the file path into an actual source, and adds it to the sink. An EmptyCallback that sits after this then runs whenever the song source ends, and opens the next song path in the file path vec into a Decoder, which is then appended to the sink.

I do this so that I can have a very large queue that is easy to control (plus has song struct info in it) with minimal open file pointers, etc, but then the sink is constantly kept at 2 songs ready to go (unless there is only 1 left to play) so gapless playback works. This works well, but like I said, if I want to change the next song in the queue during playback of the first source, I am not sure how to remove the second source from the sink and append a new one in its place.

Thanks for all the hard work on Rodio - it's been incredibly helpful, and I've learnt a lot working with the library. Hopefully when I understand it a bit more fully I can contribute back to it too :)

Lenguaje dominante
Rust
Estrellas
2.5k
Forks
338
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de RustAudio/rodio

Todos los issues de RustAudio/rodio

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.