summaryrefslogtreecommitdiff
path: root/apps/playback.c
AgeCommit message (Collapse)Author
2008-03-17It makes more sense for the callback registrar to decide if its a "oneshot" ↵Jonathan Gordon
then the callback caller. (Doing it this way means playback could(/should?) registar a disk spinup callback at init which is called every spinup without needing to be reregistered) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16685 a1c6a512-1295-4272-9138-f99709370657
2008-03-16Implement the playback event handling as a system-wide multi-purpose event ↵Miika Pekkarinen
system. Unified mpeg.c and playback.c audio event handling. Converted ata_idle_notify to use the new event handling system also. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16682 a1c6a512-1295-4272-9138-f99709370657
2008-03-09FS#8707 - Enable "Load to RAM" (HAS_TC_RAMCACHE) compilation without ↵Miika Pekkarinen
Directory Cache (HAS_DIRCACHE). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16594 a1c6a512-1295-4272-9138-f99709370657
2008-03-08Revert accidental tree commit. Sorry for that.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16574 a1c6a512-1295-4272-9138-f99709370657
2008-03-08No need to have \n here. panicf() won't output it anyway.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16570 a1c6a512-1295-4272-9138-f99709370657
2008-03-08Simplified the playback engine more and removed unnecessary code.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16552 a1c6a512-1295-4272-9138-f99709370657
2008-03-07Rewritten playback event handling. Should fix runtime statistics gathering.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16546 a1c6a512-1295-4272-9138-f99709370657
2008-03-04Pragmatic fix for FS#8681 (logf breaks scrobbling). The correct fix is a ↵Nicolas Pennequin
better event mechanism but scrobbling is currently the only track_changed_event consumer so I'll wait til I have more time. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16520 a1c6a512-1295-4272-9138-f99709370657
2008-03-04Fix FS#8675: Last song in playlist ends prematurely.Magnus Holmgren
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16518 a1c6a512-1295-4272-9138-f99709370657
2008-03-03Slightly simpler mechanism to avoid Q_AUDIO_FILL_BUFFER floods.Steve Bavin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16497 a1c6a512-1295-4272-9138-f99709370657
2008-02-29Fix odd behaviour when rebuffering occurs during playback. This is ↵Steve Bavin
hopefully the last nail in the coffins of FS#8455 and FS#8513, but I'll let some FLAC and Ogg users be the judge of that. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16459 a1c6a512-1295-4272-9138-f99709370657
2008-02-28Use a safe way to get pcm buffer track change notifications to the audio thread.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16450 a1c6a512-1295-4272-9138-f99709370657
2008-02-28Fix bookmark resume when a track is playing.Magnus Holmgren
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16445 a1c6a512-1295-4272-9138-f99709370657
2008-02-26Fix auto dir change happening one track too early (another followup of r16425).Nicolas Pennequin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16430 a1c6a512-1295-4272-9138-f99709370657
2008-02-26Fix not being able to skip to the last track in a playlist.Nicolas Pennequin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16426 a1c6a512-1295-4272-9138-f99709370657
2008-02-26Attempt to make manual track skips more responsive and more robustNicolas Pennequin
* Immediately update the playlist index on manual track skip * Try to minimise the number of calls to audio_fill_file_buffer Hopefully fixes FS#8320. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16425 a1c6a512-1295-4272-9138-f99709370657
2008-02-26Factor out duplicate code from audio_prev and audio_nextNicolas Pennequin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16424 a1c6a512-1295-4272-9138-f99709370657
2008-02-26Make audio_next_track use the wps_offset value.Nicolas Pennequin
This removes the delay between the current track title change and the next track title change in the WPS on a track skip. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16423 a1c6a512-1295-4272-9138-f99709370657
2008-02-23When starting playback, prevent the codec from starting to decode too early, ↵Magnus Holmgren
which would cause rebuffering (slowing things down) and incorrect playlist index. Hopefully fixes a bunch of playback-related bugs, such as FS#8520, FS#8525, FS#8555 and possibly FS#8511. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16392 a1c6a512-1295-4272-9138-f99709370657
2008-01-09Fix FS#5797 (Codec failure with directory skip when in file browser, with ↵Nicolas Pennequin
dircache enabled). Marking the tree context to be reloaded too early would cause the new playlist to contain files that don't exist (correct directory but wrong filenames), in turn causing the codec failures. The fix is to call reload_directory() after the playlist has been created. I also added a sanity check to avoid loading an unknown codec, which was happening as a consequence of this issue. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16039 a1c6a512-1295-4272-9138-f99709370657
2008-01-08Fix FS#6215 (player crashes after trying to resume deleted music file). As ↵Nicolas Pennequin
mentioned in the lastest comment, the problem was in trying to resume at an offset larger than the size of the file following the one that was deleted. This revealed a crash in the buffering code, which gets a fix, but we also need to intervene earlier in the track loading so that the track that gets played will be from its start. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16028 a1c6a512-1295-4272-9138-f99709370657
2008-01-08Take out some no longer needed (and overly complicated) comments, thanks to ↵Brandon Low
Nico_P git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16027 a1c6a512-1295-4272-9138-f99709370657
2008-01-08Fix FS#2687 (Rewinding at end of song confuses playback) by making the codec ↵Nicolas Pennequin
skip back if the user seeks during the transition window. This also completely fixes the small glitch in the progressbar when a user skipped back to a buffered song. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16025 a1c6a512-1295-4272-9138-f99709370657
2008-01-07Make the playlist index be incremented after the PCM track change. This ↵Nicolas Pennequin
fixes FS#8206. Special treatment is required to avoid breaking auto dir change. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16019 a1c6a512-1295-4272-9138-f99709370657
2007-11-28Fix FS8069, because Nico_P made it easyBrandon Low
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15840 a1c6a512-1295-4272-9138-f99709370657
2007-11-26Buffering callbacks rework. There is now one callback for all the events ↵Nicolas Pennequin
that can occur. Callbacks are now registred only once instead of being removed after having been called. Fix FS#8092 by flushing the audio when a rebuffer is needed. Also add some comments here and there. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15816 a1c6a512-1295-4272-9138-f99709370657
2007-11-24Commit FS#7440. The iPod Video doesn't actually have a hardware equalizer. ↵Dan Everton
It does have hardware bass/treble settings with configurable cutoff. So make the bass/treble settings use the hardware and remove the hardware equalizer configuration. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15782 a1c6a512-1295-4272-9138-f99709370657
2007-11-23revise commit r15463 - we still get the immediate display of runtime data in ↵Robert Kukla
the wps, but avoid unnecessary calls while initialising/updating the database. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15781 a1c6a512-1295-4272-9138-f99709370657
2007-11-23Save runtime info for last track in playlist as well (FS#8040)Robert Kukla
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15767 a1c6a512-1295-4272-9138-f99709370657
2007-11-22Fix FS#8201 and correct fix for FS#8040 by making the track unbuffer ↵Nicolas Pennequin
callback be called from where it should be: clear_track_info, and writing track metadata back to the main buffer *before* the callback is called and the track erased. This simplifies audio_clear_track_entries. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15748 a1c6a512-1295-4272-9138-f99709370657
2007-11-20Hopefully the last word on getting rid of yield_codecs loops (cut read chunk ↵Michael Sevakis
to 16kB). Sansa ata driver also didn't yield enough so buffering would starve other threads. Bump priority of audio thread to keep UI more responsive. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15724 a1c6a512-1295-4272-9138-f99709370657
2007-11-20Make threads responsible for explicit cancellation of their own boosted ↵Michael Sevakis
status. Sleeping and timeouts will no longer cancel it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15709 a1c6a512-1295-4272-9138-f99709370657
2007-11-19Fix FS#8040 (Gather Runtime Data not working) the right way. Also a few ↵Nicolas Pennequin
cosmetic changes and comments. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15696 a1c6a512-1295-4272-9138-f99709370657
2007-11-19Second part of FS#8104 by Bertrik Sikken: Simplification of ↵Nicolas Pennequin
audio_track_count, audio_have_tracks and audio_have_free_tracks. This hopefully won't affect anything, but the semantics of the functions have changed slightly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15693 a1c6a512-1295-4272-9138-f99709370657
2007-11-19First part of FS#8104 by Bertrik Sikken: Simplification and consistency ↵Nicolas Pennequin
improvement for the track index incrementations. There should be no functional change. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15688 a1c6a512-1295-4272-9138-f99709370657
2007-11-19Do the wait for the audio thread init in such a way to avoid an unlikely but ↵Michael Sevakis
possible roundabout deadlock. Not pretty but will suffice for the moment. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15686 a1c6a512-1295-4272-9138-f99709370657
2007-11-19Make sure initial menu item is voiced at startup. Voice thread must wait for ↵Michael Sevakis
the audio thread to finish initializing hardware. A known issue at speex commit time (perhaps only by myself ;). The behavioral refinement time begins. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15682 a1c6a512-1295-4272-9138-f99709370657
2007-11-18Make speex the new voice format for SWCODEC targets (non-Archos). Remove ↵Michael Sevakis
codec swapping and build speex voice decoding directly into the core binary. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15668 a1c6a512-1295-4272-9138-f99709370657
2007-11-18Erase lasttrack_id3 when end-of-playlist is reached. Fixes FS#8148.Nicolas Pennequin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15659 a1c6a512-1295-4272-9138-f99709370657
2007-11-14I'm a retard, this is definitely more correctBrandon Low
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15627 a1c6a512-1295-4272-9138-f99709370657
2007-11-14Might fix FS#8158, I was unable to reproduce so no guarantee.Brandon Low
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15626 a1c6a512-1295-4272-9138-f99709370657
2007-11-12Fix another NULL pointer dereference crash.Nicolas Pennequin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15591 a1c6a512-1295-4272-9138-f99709370657
2007-11-11Fix an issue that appeared in r15577, where skipping back to a track that ↵Nicolas Pennequin
has no audio data left, but still has its metadata and album art, would fail. The fix is to also clear the filesize member (as it should have been previously) to force a rebuffer when skipping back. To prevent the album art bitmap from flashing on the back skip, the whole track info struct is cleared when the track isn't needed anymore, i.e. after the PCM track change. Also a slightly unrelated but trivial change: only load album art if it's not already loaded. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15588 a1c6a512-1295-4272-9138-f99709370657
2007-11-11Load the album art before the codec because find_albumart would yield to the ↵Nicolas Pennequin
codec, which would start requesting data before the audio handle is ready. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15584 a1c6a512-1295-4272-9138-f99709370657
2007-11-11* Make the album art be updated on PCM track change, not codec track change ↵Nicolas Pennequin
(changes in audio_current_aa_hid). * On codec track change, if not all the audio data is present, only get rid of the audio data and not all the track's handles. This will prevent alum art from disappearing on codec track change after resuming playback (changes in audio_check_new_track). * Add audio_finalise_track_change() to handle what happens after the PCM track change (no functional change here). * Add some comments about how the track transition works. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15577 a1c6a512-1295-4272-9138-f99709370657
2007-11-11Fix red.Nicolas Pennequin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15573 a1c6a512-1295-4272-9138-f99709370657
2007-11-11Album art support. Based on FS#3045, but heavily modified to adapt to MoB ↵Nicolas Pennequin
and for cleanness. The cover pictures are loaded from external bitmaps. JPEG and embedded art are not supported. The pictures will only be drawn on the main display. There is no resizing but it is possible to specify the WPS bitmap size in the bitmap names (e.g. cover.100x100.bmp). The bitmaps are stored in the main buffer and read directly from there. Currently, duplicate bitmaps will simply be present several times in the buffer, but this will be improved. To enable for a target, #define HAVE_ALBUMART in its config file. For more information, see the wiki page: http://www.rockbox.org/wiki/AlbumArt. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15572 a1c6a512-1295-4272-9138-f99709370657
2007-11-10Fix a possible NULL pointer dereference I introduced in r15503 by making an ↵Nicolas Pennequin
unwise assumption. This would cause crashes on track skip in certain (very unlikely, I think) situations. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15557 a1c6a512-1295-4272-9138-f99709370657
2007-11-08Remove nexttrack_id3 and instead use the metadata present on the buffer.Nicolas Pennequin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15540 a1c6a512-1295-4272-9138-f99709370657
2007-11-08Store the metadata of the first unbuffered track in a static struct so that ↵Nicolas Pennequin
it gets displayed in the next track info while playing the last buffered track. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15539 a1c6a512-1295-4272-9138-f99709370657