summaryrefslogtreecommitdiff
path: root/apps/playback.c
AgeCommit message (Collapse)Author
2008-11-01Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do ↵Frank Gevaerts
that, it also introduces sd_*, nand_*, and mmc_*. This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657
2008-10-26Try to fix FS#9502: end playback properly if no valid files were found in a ↵Magnus Holmgren
playlist. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18891 a1c6a512-1295-4272-9138-f99709370657
2008-10-22fix FS#8124 - pressing STOP after seeking while paused causes playback to ↵Jonathan Gordon
start again for a second or 2 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18860 a1c6a512-1295-4272-9138-f99709370657
2008-10-19Codec memory reorganizationNils Wallménius
Based on a patch by Tomasz Malesinski * Merge Codec buffer and Malloc buffer into one large buffer. * The new merged buffer is now 1MB on targets with lots of memory. * Renamed codec_get_memory to codec_get_buffer and made it behave more. like plugin_get_buffer. * Bumped Codec api and min api versions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18834 a1c6a512-1295-4272-9138-f99709370657
2008-10-16Accept FS#7482 by Klaas Bosteels - return the full path of a file which ↵Jonathan Gordon
doesnt have valid tags yet (and use the end of the filename for the title) instead of before which was only using the filename git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18820 a1c6a512-1295-4272-9138-f99709370657
2008-10-16Accept FS#9480 - centralise and organise the events in the apps/ layer. Jonathan Gordon
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18819 a1c6a512-1295-4272-9138-f99709370657
2008-10-14Added #include pcm_record.hBjörn Stenberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18809 a1c6a512-1295-4272-9138-f99709370657
2008-10-07add HAVE_DISK_STORAGE, and use that instead of HAVE_FLASH_STORAGE when ↵Frank Gevaerts
checking for an actual disk (i.e. related to spindown, skipping,...) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18735 a1c6a512-1295-4272-9138-f99709370657
2008-08-15FS#9281 Rename of splash functions.Nils Wallménius
* Remove gui_splash() * Rename gui_syncsplash() to splashf() and remove its voice capabilities. * Rename the internal splash() to splash_internal() and introduce an externally visible splash() that handles simple splashing without printf functionality e.g. splash(HZ, ID2P(LANG_FOO)); or splash(HZ, "foo"); if a LANG_* id is passed it will be voiced. * Adjust all places that called gui_syncsplash() to use the correct variant from above. * Export both new functions to plugins and adjust places calling rb->splash() to use the correct variant so that we now have naming consistency between the core and plugins. * Fix one latent bug that would cause my sim to crash with the above changes and correct P2STR and P2ID macros, thanks to pondlife. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18282 a1c6a512-1295-4272-9138-f99709370657
2008-07-15Accept FS#8918: Voice multiple thumbnails and talk race fixes.Stéphane Doyon
-Allows loading multiple thumbnails back-to-back in the one thumbnail buffer. -Mutex to prevent race conditions with talk queue indices and thumbnail buffer state. -Synchronous shutup. -Shutup is a noop if no voice is queued. -mp3_play_stop() does nothing until the audio thread is ready. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18046 a1c6a512-1295-4272-9138-f99709370657
2008-06-30Fix FS#8977. The issue was caused by multiple successive calls to ↵Nicolas Pennequin
audio_load_track() happening before the corresponding calls to audio_finish_load_track(), resulting in disappearing tracks. I added the track_load_started boolean flag as a means to prevent audio_load_track() from doing anything if a call to audio_finish_load_track is pending. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17891 a1c6a512-1295-4272-9138-f99709370657
2008-06-29Fix FS#9110 and its maybe-dupes.Nicolas Pennequin
The issue happened when the value of 'filling' was STATE_FINISHED: the low_buffer_callback wouldn't do anything even when there would still be data remaining to be buffered, leading to a shortage of audio data. Only making the callback act even when filling is STATE_FINISHED (the simple fix) isn't right because of cases when the last track in the playlist is fully buffered. Therefore I added a new state to distinguish between when the last track is fully buffered (STATE_FINISHED) and when it isn't (STATE_END_OF_PLAYLIST). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17875 a1c6a512-1295-4272-9138-f99709370657
2008-06-28Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg
later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-05-05Restore Zagor's copyright from before the WPS tokenizer. I shouldn't have ↵Nicolas Pennequin
removed it. Also add mine in playback.c, alongside Slasheri's. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17368 a1c6a512-1295-4272-9138-f99709370657
2008-04-28Cleaned up playblack.h header file and usage of it.Bertrik Sikken
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17276 a1c6a512-1295-4272-9138-f99709370657
2008-04-16bufgetid3 should be used carefully, as it can return NULL.Nicolas Pennequin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17143 a1c6a512-1295-4272-9138-f99709370657
2008-04-16Fix FS#8902 (NSF files get skipped). The cause was too strict metadata ↵Nicolas Pennequin
checking (the NSF metadata parser doesn't fill the 'length' field). Hopefully there won't be any problems with that anymore. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17142 a1c6a512-1295-4272-9138-f99709370657
2008-04-15audio_current_track: take wps_offset into account when no buffered metadata ↵Nicolas Pennequin
is available, and avoid using playlist_peek, which hits on the disk when dircache isn't enabled. This should make skipping nicer. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17128 a1c6a512-1295-4272-9138-f99709370657
2008-04-15Some bugfixes after r17109:Nicolas Pennequin
* Fix FS#8893 by plugging a file descriptor leak in audio_load_track. * Fix a possible null pointer dereference by not allowing audio_current_track to return NULL. * Make audio_current_track return prevtrack_id3 only during an automatic track skip. Fixes the wrong metadata being displayed for a short time after a backwards skip. -Cette ligne, et les suivantes ci-dessous, seront ignorées-- M apps/playback.c git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17126 a1c6a512-1295-4272-9138-f99709370657
2008-04-15Remove a global variable which is (hopefully) not needed. Also fixes a very ↵Steve Bavin
minor bug where restarting playback after a playlist ends would play the final 3 seconds again. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17117 a1c6a512-1295-4272-9138-f99709370657
2008-04-14A rather big change to how tracks are loaded: there are now two parts to the ↵Nicolas Pennequin
process and metadata loading is done by the buffering thread (except for the first unbuffered track). The audio thread now calls audio_load_track, and once the metadata is loaded, the buffering thread sends an event which will make the audio thread call audio_finish_load_track. This one then takes care of the rest of the loading. This method makes skipping noticeably faster for unbuffered tracks, and especially backwards. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17109 a1c6a512-1295-4272-9138-f99709370657
2008-04-14Revert what was left of r17018 until I find a better way. It had quirks in ↵Nicolas Pennequin
some cases, and doesn't play well with what I'm about to commit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17108 a1c6a512-1295-4272-9138-f99709370657
2008-04-14FS#8882: Fix the bug where skipping backwards with Ogg files could result in ↵Nicolas Pennequin
a skip forward (FS#8508). The problem was introduced by a one-line change in r16025, so we revert it. At the time I thought that line had become useless but obviously I was wrong. Thanks to Greg Erwin for finding the fix. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17107 a1c6a512-1295-4272-9138-f99709370657
2008-04-12Commit FS#8822 by Magnus Holmgren. Fixes resuming previously playing WMA ↵Michael Giacomelli
files after a reboot. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17090 a1c6a512-1295-4272-9138-f99709370657
2008-04-07Bring the WPS playlist index display into sync with the track being played ↵Nicolas Pennequin
by using the index field of the ID3 info struct instead of directly asking the playlist code. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17018 a1c6a512-1295-4272-9138-f99709370657
2008-04-06Enable nocache sections using the linker. PP5022/4 must use SW_CORELOCK now ↵Michael Sevakis
with shared variables in DRAM (it seems swp(b) is at least partially broken on all PP or I'm doing something very wrong here :\). For core-shared data use SHAREDBSS/DATA_ATTR. NOCACHEBSS/DATA_ATTR is available whether or not single core is forced for static peripheral-DMA buffer allocation without use of the UNCACHED_ADDR macro in code and is likely useful on a non-PP target with a data cache (although not actually enabled in config.h and the .lds's in this commit). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16981 a1c6a512-1295-4272-9138-f99709370657
2008-04-03Fix FS#8513 (Playback occasionally repeats a track when rebuffering occurs) ↵Nicolas Pennequin
and hopefully others by essentially reverting r16019, parts of r16425 and most bugfix followups. This means we're back to having a desynchronized playlist index in the WPS. audio_check_new_track() needs a serious rework before we can make improvements in that area without breaking things. playlist_checkend() isn't used anymore but I'm not removing it for now because it might prove useful later on. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16955 a1c6a512-1295-4272-9138-f99709370657
2008-04-03Migrate the buffering code to the new events system.Nicolas Pennequin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16950 a1c6a512-1295-4272-9138-f99709370657
2008-04-03Fix an issue introduced by r16930 where rebuffering would happen one track ↵Nicolas Pennequin
too early because track were counted after moving to the next one instead of before. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16948 a1c6a512-1295-4272-9138-f99709370657
2008-04-03Move audio_set_elapsed to mpa.c, as recommended by the TODO note. Please ↵Nicolas Pennequin
correct me if affecting ci->id3->elapsed directly (ie without using ci->set_elapsed) is wrong. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16945 a1c6a512-1295-4272-9138-f99709370657
2008-04-02Fix a possible (though unlikely) deadlock condition spotted by jhMikeS. It ↵Nicolas Pennequin
would involve both the buffering and the audio thread sending synchronous messages to one another. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16931 a1c6a512-1295-4272-9138-f99709370657
2008-04-02Fix for FS#8601 by pondlife: the disk no longer spins up on a track change ↵Nicolas Pennequin
when dircache is disabled. This issue was introduced by me in r16019 by adding a call to playlist_peek() in audio_check_new_track(). This fix adds a new playlist API call to work around the problem until we find a better solution. There are also a few simplifications and comment corrections. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16930 a1c6a512-1295-4272-9138-f99709370657
2008-03-30Fixes FS#8597 (dropouts while crossfading) via keeping CPU boosted while ↵Andree Buschmann
crossfading is active. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16889 a1c6a512-1295-4272-9138-f99709370657
2008-03-29Fix sim warnings.Nicolas Pennequin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16881 a1c6a512-1295-4272-9138-f99709370657
2008-03-29Boost the audio thread while it's filling the buffer. In the audio and the ↵Nicolas Pennequin
buffering threads, only cancel cpu boost when not filling. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16880 a1c6a512-1295-4272-9138-f99709370657
2008-03-29Use queue_empty instead of queue_peek again now that we don't care about the ↵Nicolas Pennequin
event type anymore. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16876 a1c6a512-1295-4272-9138-f99709370657
2008-03-29Move codec_get_file_pos somewhere else like the comment said should be done. ↵Michael Sevakis
Codec API version increment was needed so update all codecs. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16874 a1c6a512-1295-4272-9138-f99709370657
2008-03-28Track playback filling state with a state-machine approach. There shouldn't ↵Nicolas Pennequin
be any change in behaviour but things are simpler. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16868 a1c6a512-1295-4272-9138-f99709370657
2008-03-28Revert my earlier const madness, we'll keep the parameter lists simple.Steve Bavin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16863 a1c6a512-1295-4272-9138-f99709370657
2008-03-28Oops, another pondlife puddle of red.Steve Bavin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16862 a1c6a512-1295-4272-9138-f99709370657
2008-03-28The const police raid playback.c, should be no change to behaviour.Steve Bavin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16860 a1c6a512-1295-4272-9138-f99709370657
2008-03-25Oops, more red. That can't be static yet.Steve Bavin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16803 a1c6a512-1295-4272-9138-f99709370657
2008-03-25A little more consting/staticing, no functional change.Steve Bavin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16801 a1c6a512-1295-4272-9138-f99709370657
2008-03-25Add a complete priority inheritance implementation to the scheduler (all ↵Michael Sevakis
mutex ownership and queue_send calls are inheritable). Priorities are differential so that dispatch depends on the runnable range of priorities. Codec priority can therefore be raised in small steps (pcmbuf updated to enable). Simplify the kernel functions to ease implementation and use the same kernel.c for both sim and target (I'm tired of maintaining two ;_). 1) Not sure if a minor audio break at first buffering issue will exist on large-sector disks (the main mutex speed issue was genuinely resolved earlier). At this point it's best dealt with at the buffering level. It seems a larger filechunk could be used again. 2) Perhaps 64-bit sims will have some minor issues (finicky) but a backroll of the code of concern there is a 5-minute job. All kernel objects become incompatible so a full rebuild and update is needed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16791 a1c6a512-1295-4272-9138-f99709370657
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