summaryrefslogtreecommitdiff
path: root/apps/mpeg.c (follow)
Commit message (Collapse)AuthorAge
* Implement time-based resume and playback start.Michael Sevakis2014-03-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | This complements offset-based resume and playback start funcionality. The implementation is global on both HWCODEC and SWCODEC. Basically, if either the specified elapsed or offset are non-zero, it indicates a mid-track resume. To resume by time only, set elapsed to nonzero and offset to zero. To resume by offset only, set offset to nonzero and elapsed to zero. Which one the codec uses and which has priority is up to the codec; however, using an elapsed time covers more cases: * Codecs not able to use an offset such as VGM or other atomic formats * Starting playback at a nonzero elapsed time from a source that contains no offset, such as a cuesheet The change re-versions pretty much everything from tagcache to nvram. Change-Id: Ic7aebb24e99a03ae99585c5e236eba960d163f38 Reviewed-on: http://gerrit.rockbox.org/516 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested: Michael Sevakis <jethead71@rockbox.org>
* talk: Remove superflous call to talk_init().Thomas Martitz2014-02-02
| | | | | | | talk_init() is called by settings_apply() already which is called on boot. Doing it again means loading the voicefile a second time which isn't necessary. Change-Id: I4decd16401e63bf87338d3163c99d06d69fe3a3c
* hwcodec/talk.c: Give the thumbnail buffer regardless of the talk buffer policy.Thomas Martitz2014-01-26
| | | | | | | | | | | When the policy is not set, it'll by default not give the clip buffer away. Callers of core_alloc_maximum() suffer from this. However, the thumbnail buffer can be easily freed when needed because nothing needs to be reloaded from disk when it is reallocated (thumbnail clips are loaded on demand, when in the file browser). Do this to give core_alloc_maximum() callers a better chance to succeed with the default talk buffer policy. Change-Id: I8c0da29c520612ca903f6c930bd7c74ae97eca3b
* Fix more reds.Thomas Martitz2013-12-23
| | | | Change-Id: I13e9a0398efe0dab222f2a9c4f5d9295570e4dfd
* hwcodec: Need to grab audio buffer before recording.Thomas Martitz2013-12-23
| | | | | | | This was missed in 22e802e because I didn't realize that hwcodec doesn't compile pcm_record.c. Change-Id: I48cd4c2beec0a3d01caf06f2a2ced98be22a3673
* playback,talk: Share audiobuffer via core_alloc_maximum().Thomas Martitz2013-12-23
| | | | | | | | | | | | | | | | This fixes the radioart crash that was the result of buffering.c working on a freed buffer at the same time as buflib (radioart uses buffering.c for the images). With this change the buffer is owned by buflib exclusively so this cannot happen. As a result, audio_get_buffer() doesn't exist anymore. Callers should call core_alloc_maximum() directly. This buffer needs to be protected as usual against movement if necessary (previously it was not protected at all which cased the radioart crash), To get most of it they can adjust the willingness of the talk engine to give its buffer away (at the expense of disabling voice interface) with the new talk_buffer_set_policy() function. Change-Id: I52123012208d04967876a304451d634e2bef3a33
* Get rid of some superfluous single-purpose functions in playback.Michael Sevakis2013-07-13
| | | | | | | | | | | * Remove explicit tracking of elapsed time of previous track. * Remove function to obtain auto skip flag. * Most playback events now carry the extra information instead and pass 'struct track_event *' for data. * Tweak scrobbler to use PLAYBACK_EVENT_TRACK_FINISH, which makes it cleaner and removes the struct mp3entry. Change-Id: I500d2abb4056a32646496efc3617406e36811ec5
* Fix whitespace in files for following commit.Michael Sevakis2013-07-12
| | | | Change-Id: I4adb8a152e9b99fcd26d95da7334d7d0cbe2a036
* Tweak paramters of mp3_play_data and callback.Michael Sevakis2012-03-04
| | | | | | | | | Use generic void * and size_t and make mp3_play_data and its callback agree on types. Use mp3_play_callback_t instead of prototyping right in the function call (so it's not so messy to look at). Change doesn't appear to require plugin API version increment. Change-Id: Idcab2740ee316a2beb6e0a87b8f4934d9d6b3dd8
* Fix red?Nick Peskett2011-12-16
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31322 a1c6a512-1295-4272-9138-f99709370657
* FS #12419 : Support for embedded cuesheets.Nick Peskett2011-12-16
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31321 a1c6a512-1295-4272-9138-f99709370657
* Buflib: Make shrinking and buflib_available() smarter.Thomas Martitz2011-11-17
| | | | | | | | | | | | | | | | | * shrinking now considers freespace just before the alloc-to-be-shrinked, that means less (or sometimes none at all) is taken from the audio buffer. * core_available() now searches for the best free space, instead of simply the end, i.e. it will not return 0 if the audio buffer is allocated and there's free space before it. It also runs a compaction to ensure maximum contiguous memory. audio_buffer_available() is also enhanced. It now considers the 256K reserve buffer, and returns free buflib space instead if the audio buffer is short. This all fixes the root problem of FS#12344 (Sansa Clip+: PANIC occurred when dircache is enabled), that alloced from the audio buffer, even if it was very short and buflib had many more available as free space before it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31006 a1c6a512-1295-4272-9138-f99709370657
* Fix warning and typos.Thomas Martitz2011-11-06
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30912 a1c6a512-1295-4272-9138-f99709370657
* hwcodec: fix shrink_callback resuming playback wrongly, and add checksThomas Martitz2011-11-06
| | | | | | | | if the voice is bigger than the audiobuffer. NOTE: This is the case on the sim so voice doesn't appear to work currently on hwcodec. Someone needs to verify on a real target. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30910 a1c6a512-1295-4272-9138-f99709370657
* Another fix for audio_get_buffer() on hwcodec by Thomas Martitz.Jens Arnold2011-10-09
| | | | | | | | Some functions must only be called when audio is already initialized, due to talk <-> audio interdependency, same as on swcodec. This makes hwcodec boot and play music again. Voice menus also working again, talk clips not yet. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30738 a1c6a512-1295-4272-9138-f99709370657
* Fix audio_get_buffer() implementation on hwcodec, to be similar to the ↵Thomas Martitz2011-10-09
| | | | | | swcodec one. Should make hwcodec bood again. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30737 a1c6a512-1295-4272-9138-f99709370657
* Fix h100 red and other warnings.Thomas Martitz2011-08-30
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30384 a1c6a512-1295-4272-9138-f99709370657
* Fix hwcodec red.Thomas Martitz2011-08-30
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30383 a1c6a512-1295-4272-9138-f99709370657
* GSoC/Buflib: Enable compaction in buflib.Thomas Martitz2011-08-30
| | | | | | | | | | | | | | | | | | | This enables the ability to allocate (and free) memory dynamically without fragmentation, through compaction. This means allocations can move and fragmentation be reduced. Most changes are preparing Rockbox for this, which many times means adding a move callback which can temporarily disable movement when the corresponding code is in a critical section. For now, the audio buffer allocation has a central role, because it's the one having allocated most. This buffer is able to shrink itself, for which it needs to stop playback for a very short moment. For this, audio_buffer_available() returns the size of the audio buffer which can possibly be used by other allocations because the audio buffer can shrink. lastfm scrobbling and timestretch can now be toggled at runtime without requiring a reboot. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30381 a1c6a512-1295-4272-9138-f99709370657
* GSoC/Buflib: Add buflib memory alocator to the core.Thomas Martitz2011-08-30
| | | | | | | | | | | | | | | | | The buflib memory allocator is handle based and can free and compact, move or resize memory on demand. This allows to effeciently allocate memory dynamically without an MMU, by avoiding fragmentation through memory compaction. This patch adds the buflib library to the core, along with convinience wrappers to omit the context parameter. Compaction is not yet enabled, but will be in a later patch. Therefore, this acts as a replacement for buffer_alloc/buffer_get_buffer() with the benifit of a debug menu. See buflib.h for some API documentation. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30380 a1c6a512-1295-4272-9138-f99709370657
* Fix remaining problems.Thomas Martitz2011-08-14
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30311 a1c6a512-1295-4272-9138-f99709370657
* Fix errors and warnings.Thomas Martitz2011-08-14
| | | | | | | The buffer_offset paramter of audio_init_recording() is removed as it was unused in both implementations. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30310 a1c6a512-1295-4272-9138-f99709370657
* GSoC/Buflib: Replace all direct accesses to audiobuf with buffer API functions.Thomas Martitz2011-08-14
| | | | | | | | | | | | | | | | | | | | | | | Namely, introduce buffer_get_buffer() and buffer_release_buffer(). buffer_get_buffer() aquires all available and grabs a lock, attempting to call buffer_alloc() or buffer_get_buffer() while this lock is locked will cause a panicf() (doesn't actually happen, but is for debugging purpose). buffer_release_buffer() unlocks that lock and can additionally increment the audiobuf buffer to make an allocation. Pass 0 to only unlock if buffer was used temporarily only. buffer_available() is a replacement function to query audiobuflen, i.e. what's left in the buffer. Buffer init is moved up in the init chain and handles ipodvideo64mb internally. Further changes happened to mp3data.c and talk.c as to not call the above API functions, but get the buffer from callers. The caller is the audio system which has the buffer lock while mp3data.c and talk mess with the buffer. mpeg.c now implements some buffer related functions of playback.h, especially audio_get_buffer(), allowing to reduce #ifdef hell a tiny bit. audiobuf and audiobufend are local to buffer.c now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30308 a1c6a512-1295-4272-9138-f99709370657
* Remove next reported 'set but unused' warnings.Andree Buschmann2011-05-23
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29920 a1c6a512-1295-4272-9138-f99709370657
* Fix red and yellow. Move resume_index from mp3entry to playlist_info struct. ↵Andree Buschmann2011-04-07
| | | | | | Bump codec api. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29691 a1c6a512-1295-4272-9138-f99709370657
* All kernel objects in code shared amongs targets (core, plugins, codecs) ↵Michael Sevakis2011-02-14
| | | | | | should be declared SHAREDBSS_ATTR as any core could potentially touch them even though they seem only to involve threads on one core. The exception is target code for particular CPUs where proper allocation is fixed. playlist.c was a little odd too-- use one mutex for the current playlist and a separate one for created playlists (still pondering the necessity of more than one). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29305 a1c6a512-1295-4272-9138-f99709370657
* Clean up multiple definitions of RAM size. Remove -DMEM (make) and MEM ↵Andree Buschmann2011-02-02
| | | | | | (code), use the already defined MEMORYSIZE instead. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29189 a1c6a512-1295-4272-9138-f99709370657
* Separate mas35xx lowlevel stuff. Move SH specific bits to target tree. ↵Marcin Bukat2010-10-31
| | | | | | FS#11189 by me. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28425 a1c6a512-1295-4272-9138-f99709370657
* Fix HWCODEC playback broken in r27773. mpeg.c declared playlist functions on ↵Jens Arnold2010-08-22
| | | | | | its own instead of including playlist.h due to its history, and now they got out of sync... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27860 a1c6a512-1295-4272-9138-f99709370657
* Change cuesheet handling so the id3 info is not spoofed anymore. If ↵Jonathan Gordon2010-06-06
| | | | | | something wants the subtracks info it is easy to get to. This makes next track display in the skins show the next subtrack if we are in a cuesheet git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26611 a1c6a512-1295-4272-9138-f99709370657
* Fix yellow.Steve Bavin2010-05-07
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25880 a1c6a512-1295-4272-9138-f99709370657
* Minor const police raid.Steve Bavin2010-05-07
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25879 a1c6a512-1295-4272-9138-f99709370657
* Make open() posix compliant api-wise. A few calls (those with O_CREAT) need ↵Thomas Martitz2010-05-06
| | | | | | the additional optional mode parameter so add it. Impact for the core is almost zero, as open() is a wrapper macro for the real open function which doesn't take the variable parameter. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25844 a1c6a512-1295-4272-9138-f99709370657
* Remove more tabsAndree Buschmann2010-02-07
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24550 a1c6a512-1295-4272-9138-f99709370657
* Make a few global variables static instead of global where possibleBertrik Sikken2010-01-09
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24206 a1c6a512-1295-4272-9138-f99709370657
* mpeg.h/c cleanupJeffrey Goode2009-11-16
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23652 a1c6a512-1295-4272-9138-f99709370657
* Cleanup audio.h, related functionsJeffrey Goode2009-11-16
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23651 a1c6a512-1295-4272-9138-f99709370657
* Fix yellow, definesJeffrey Goode2009-10-31
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23446 a1c6a512-1295-4272-9138-f99709370657
* FS#10739: playback.c code splitJeffrey Goode2009-10-31
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23444 a1c6a512-1295-4272-9138-f99709370657
* fix FS#10453 - the cuesheet changes broke playback on swcodec, rework it so ↵Jonathan Gordon2009-07-20
| | | | | | | | | it uses the audio buffer instead of a temp buffer from the start (which also removes one pretty big memcpy) also remove the audio_filename from the cuesheet struct as its useless git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21982 a1c6a512-1295-4272-9138-f99709370657
* woops, remove that sim code which I forgot to remove from the older versions ↵Jonathan Gordon2009-07-20
| | | | | | of the patch... ordinarily I would have just said fix red, but that would have been boring, and because rasher asked so nicley that we stop it, I thought I'd do him the curtosy... this is also part of my on going goal to increase global warming using the Rockbox botnet^H^H^H^H^H^Hbuild system... also, maybe its bed time? git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21979 a1c6a512-1295-4272-9138-f99709370657
* rework cuesheet support:Jonathan Gordon2009-07-20
| | | | | | | | | | | swcodec: search for a .cue during buffering (with the possibility of adding embedded cuesheets later) hwcodec: search for a .cue when the id3 info for the current track is requested for the first time (disk should be spining so non issue) major beenfit from this is simplofy cuesheet handling code a bit... if mp3entry.cuesheet != NULL then there is a valid cuesheet.. no need to worry about if its enabled and preloaded. There is the possibility of putting the next/prev subtrack handling inside the playback code (as well as the id3 updating stuff (see FS#9789 for more info), but thats probably not a good idea. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21978 a1c6a512-1295-4272-9138-f99709370657
* FS#10080Nils Wallménius2009-07-14
| | | | | | | | | | * Move strncpy() from core to the pluginlib * Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins * Drop strncpy() from the codec api as no codec used it * Bump codec and plugin api versions git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
* Simplify some redundant boolean expressionsBertrik Sikken2009-05-21
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21013 a1c6a512-1295-4272-9138-f99709370657
* Remove unused function audio_has_changed_track from apps/mpeg.cBertrik Sikken2009-05-09
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20893 a1c6a512-1295-4272-9138-f99709370657
* FS9795 - some playback cleanup. Jonathan Gordon2009-04-06
| | | | | | | | | | | * Use events to notify things when the track has changed instead of the nasty has_track_changed() * Event for when the mp3entry for the next track is avilable (which allows alot more tags to be static which means less redrawing in the WPS) * virtually guarentee that the mp3entry sturct returned by audio_current/next_track() is going to be valid for the duration of the current track. The only time it wont be now is during the time between the codec finishing the previous track and the next track actually starting (~2s), but this is not an issue as long as it is called again when the TRACK_CHANGED event happens (or just use the pointer that gives) It is still possible to confuse the WPS with the next tracks id3 info being displayed but this should fix itself up faster than it used to (and be harder to do) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20633 a1c6a512-1295-4272-9138-f99709370657
* Cosmetic fix: remove duplicate semicolonsBertrik Sikken2009-03-04
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20198 a1c6a512-1295-4272-9138-f99709370657
* Fix some memset calls that use the wrong order for arguments.Tom Ross2009-03-02
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20165 a1c6a512-1295-4272-9138-f99709370657
* Don't send a trackchange event at end of playlist. Fixes 'Follow Playlist' ↵Jens Arnold2009-02-16
| | | | | | on hwcodec at end-of-playlist, including the related null pointer access. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20014 a1c6a512-1295-4272-9138-f99709370657
* Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do ↵Frank Gevaerts2008-11-01
| | | | | | | | | 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