Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gapless playback feature #36

Closed
wants to merge 5 commits into from
Closed

gapless playback feature #36

wants to merge 5 commits into from

Conversation

selmf
Copy link

@selmf selmf commented Jul 25, 2012

Add gapless playback for audio files that natively support it to pragha. Comments welcome ;)

…setting of played songs pixbuf in update_pixbuf_state_on_path().
…rmats.

Use playbin2s "about-to-finish"-signal to prepare the next track and set it's uri. Once the track change has happened, playbin2 will send a "playbin2-stream-changed" message. Catch the message, update playlist and gui.
If for any reason the next track can not be prepared before playbin2 finishes the current track, the EOS (end of stream) signal will trigger the non-gapless playback_advance code.

Note: Gapless playback will only work with file formats that do not use padding. FLAC and Ogg Vorbis (and possibly others) will be fine, but mp3 does not work. Nevertheless, even mp3 playback will benefit from these changes as they eliminate any gaps resulting from playback state changes.
if(cwin->cstate->curr_mobj->file_type == FILE_CDDA ||
cwin->cstate->curr_mobj->file_type == FILE_HTTP) {
g_object_set(G_OBJECT(cwin->cgst->pipeline), "uri", cwin->cstate->curr_mobj->file, NULL);
g_free (uri);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uri always is NULL

@selmf
Copy link
Author

selmf commented Jul 25, 2012

Thanks for the comments, I'm working on it. Clearing the progress bar works fine, will post a new commit as soon as I have finished de-uglyfying the rest :)

- Gapless track change to a stream uri results in previous songs length playing time reported as song length by gstreamer. Upstream bug? For some reason, this persisted in tags->length... For now, make sure the length tag is set to 0 so we don't get progress bar errors.
- Improve codin style
… percentual value instead of stream name and a zero time value. Also fixes remaining problem with song length bug showing while buffering.
@matiasdelellis
Copy link
Contributor

Ohh.. I see you continued developing. ;)
Sorry, but I do not arrived any notification. I check it tomorrow. You expect to make anything else?

@selmf
Copy link
Author

selmf commented Aug 1, 2012

Actually, yes. Changing to a non-existent track in the playlist seems to cause all following tracks to be considered broken by pragha. As this leeds to segfault, I definitely have to fix it. I have stumbled on a quite similar bug in my early experiments on gapless with pragha, but while both are caused by playlist-issues they seem a little different...
Could take some time.

I also encountered an issue with playbin2 switching to a FLAC file from an mp3. Took some seconds to start playback, played about one second and jumped a few seconds forward, not playing what was in-between...
Have to write a minimal testcase for this stuff to check if it is a gstreamer-bug.

Well, once the gapless code is sorted out I will probably have a look at gstreamers replay gain plugins.

@matiasdelellis
Copy link
Contributor

Just a note to remember:
To work around several problems when changing song, must use the bus message GST_MESSAGE_STREAM_START.
Description: "Message indicating start of a new stream. Useful e.g. when using playbin in gapless playback mode, to get notified when the next title actually starts playing (which will be some time after the URI for the next title has been set)."

I found it when see the port of rhyntombox to gstreamer 1.0. But it seems that does not exist in 0.10.. :S

Regards.

p.s: Unfortunately there are many changes in the bancked, and this patch is not applicable. Sorry. After solving other problems, maybe I dedicate with this.

@selmf
Copy link
Author

selmf commented Oct 25, 2012

No problem - thanks for the note, this might help. I still want to see
this in pragha but the solutions I found for dealing with song-change
problems made me feel really uncomfortable because they only dealt with
symptoms. So I guess it's time to catch up with the backend changes...

On 25.10.2012 16:30, matiasdelellis wrote:

Just a note to remember:
To work around several problems when changing song, must use the bus
message GST_MESSAGE_STREAM_START.
Description: "Message indicating start of a new stream. Useful e.g.
when using playbin in gapless playback mode, to get notified when the
next title actually starts playing (which will be some time after the
URI for the next title has been set)."

I found it when see the port of rhyntombox to gstreamer 1.0. But it
seems that does not exist in 0.10.. :S

Regards.

p.s: Unfortunately there are many changes in the bancked, and this
patch is not applicable. Sorry. After solving other problems, maybe I
dedicate with this.


Reply to this email directly or view it on GitHub
#36 (comment).

Conflicts:
	src/current-playlist.c
	src/pragha-backend.c
	src/pragha.h
@selmf selmf closed this Jan 2, 2013
@ghost ghost mentioned this pull request Oct 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants