Commit graph

647 commits

Author SHA1 Message Date
Bertrik Sikken
c97e503a10 Cleaned up playblack.h header file and usage of it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17276 a1c6a512-1295-4272-9138-f99709370657
2008-04-28 14:13:13 +00:00
Nicolas Pennequin
2cf6345a0e bufgetid3 should be used carefully, as it can return NULL.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17143 a1c6a512-1295-4272-9138-f99709370657
2008-04-16 16:41:35 +00:00
Nicolas Pennequin
de026dcede Fix FS#8902 (NSF files get skipped). The cause was too strict metadata 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-16 16:18:05 +00:00
Nicolas Pennequin
babd3beee3 audio_current_track: take wps_offset into account when no buffered metadata 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-15 20:59:47 +00:00
Nicolas Pennequin
b36d3c0be2 Some bugfixes after r17109:
* 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-15 19:20:57 +00:00
Steve Bavin
e50202c5c4 Remove a global variable which is (hopefully) not needed. Also fixes a very 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-15 12:38:17 +00:00
Nicolas Pennequin
4e2de44b44 A rather big change to how tracks are loaded: there are now two parts to the 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-14 16:17:47 +00:00
Nicolas Pennequin
a5ad74ffca Revert what was left of r17018 until I find a better way. It had quirks in 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-14 15:51:40 +00:00
Nicolas Pennequin
3c9625969b FS#8882: Fix the bug where skipping backwards with Ogg files could result in 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-14 10:52:16 +00:00
Michael Giacomelli
9a946f6022 Commit FS#8822 by Magnus Holmgren. Fixes resuming previously playing WMA files after a reboot.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17090 a1c6a512-1295-4272-9138-f99709370657
2008-04-12 19:52:31 +00:00
Nicolas Pennequin
977069a41d Bring the WPS playlist index display into sync with the track being played 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-07 13:43:09 +00:00
Michael Sevakis
05099149f1 Enable nocache sections using the linker. PP5022/4 must use SW_CORELOCK now 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-06 04:34:57 +00:00
Nicolas Pennequin
fe9eb68ec0 Fix FS#8513 (Playback occasionally repeats a track when rebuffering occurs) 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-03 21:40:07 +00:00
Nicolas Pennequin
33f522de8b Migrate the buffering code to the new events system.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16950 a1c6a512-1295-4272-9138-f99709370657
2008-04-03 17:51:53 +00:00
Nicolas Pennequin
a3ed95247c Fix an issue introduced by r16930 where rebuffering would happen one track 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-03 15:30:42 +00:00
Nicolas Pennequin
73a71a4712 Move audio_set_elapsed to mpa.c, as recommended by the TODO note. Please 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-03 12:13:03 +00:00
Nicolas Pennequin
bb40e6ed15 Fix a possible (though unlikely) deadlock condition spotted by jhMikeS. It 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-02 17:18:15 +00:00
Nicolas Pennequin
03b54c29d7 Fix for FS#8601 by pondlife: the disk no longer spins up on a track change 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-04-02 17:04:59 +00:00
Andree Buschmann
63acf3eb16 Fixes FS#8597 (dropouts while crossfading) via keeping CPU boosted while crossfading is active.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16889 a1c6a512-1295-4272-9138-f99709370657
2008-03-30 10:08:08 +00:00
Nicolas Pennequin
12b6c847c5 Fix sim warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16881 a1c6a512-1295-4272-9138-f99709370657
2008-03-29 17:40:04 +00:00
Nicolas Pennequin
732df386af Boost the audio thread while it's filling the buffer. In the audio and the 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-29 17:28:30 +00:00
Nicolas Pennequin
b71cbd599b Use queue_empty instead of queue_peek again now that we don't care about the event type anymore.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16876 a1c6a512-1295-4272-9138-f99709370657
2008-03-29 13:32:37 +00:00
Michael Sevakis
4855e734f3 Move codec_get_file_pos somewhere else like the comment said should be done. 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-29 06:36:53 +00:00
Nicolas Pennequin
f68147e5eb Track playback filling state with a state-machine approach. There shouldn't 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-28 20:18:53 +00:00
Steve Bavin
135cc757bd Revert my earlier const madness, we'll keep the parameter lists simple.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16863 a1c6a512-1295-4272-9138-f99709370657
2008-03-28 12:51:33 +00:00
Steve Bavin
3d0b7c6901 Oops, another pondlife puddle of red.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16862 a1c6a512-1295-4272-9138-f99709370657
2008-03-28 11:43:08 +00:00
Steve Bavin
c9df8fd87b The const police raid playback.c, should be no change to behaviour.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16860 a1c6a512-1295-4272-9138-f99709370657
2008-03-28 11:24:24 +00:00
Steve Bavin
76691030da Oops, more red. That can't be static yet.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16803 a1c6a512-1295-4272-9138-f99709370657
2008-03-25 19:46:35 +00:00
Steve Bavin
38ed901284 A little more consting/staticing, no functional change.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16801 a1c6a512-1295-4272-9138-f99709370657
2008-03-25 19:26:00 +00:00
Michael Sevakis
27cf677339 Add a complete priority inheritance implementation to the scheduler (all 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-25 02:34:12 +00:00
Jonathan Gordon
a67e5d89ef It makes more sense for the callback registrar to decide if its a "oneshot" 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-17 05:22:53 +00:00
Miika Pekkarinen
19c6e66c13 Implement the playback event handling as a system-wide multi-purpose event 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-16 13:55:16 +00:00
Miika Pekkarinen
6ab1c90513 FS#8707 - Enable "Load to RAM" (HAS_TC_RAMCACHE) compilation without Directory Cache (HAS_DIRCACHE).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16594 a1c6a512-1295-4272-9138-f99709370657
2008-03-09 20:33:19 +00:00
Jens Arnold
8c6920e343 Revert accidental tree commit. Sorry for that.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16574 a1c6a512-1295-4272-9138-f99709370657
2008-03-08 23:50:55 +00:00
Jens Arnold
d1ed7c37b1 No need to have \n here. panicf() won't output it anyway.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16570 a1c6a512-1295-4272-9138-f99709370657
2008-03-08 23:34:43 +00:00
Miika Pekkarinen
d8204fa11e Simplified the playback engine more and removed unnecessary code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16552 a1c6a512-1295-4272-9138-f99709370657
2008-03-08 08:05:29 +00:00
Miika Pekkarinen
2ccdc48ee9 Rewritten playback event handling. Should fix runtime statistics gathering.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16546 a1c6a512-1295-4272-9138-f99709370657
2008-03-07 22:56:51 +00:00
Nicolas Pennequin
0fd6a04eee Pragmatic fix for FS#8681 (logf breaks scrobbling). The correct fix is a 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-04 22:35:51 +00:00
Magnus Holmgren
c8d2a2458d Fix FS#8675: Last song in playlist ends prematurely.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16518 a1c6a512-1295-4272-9138-f99709370657
2008-03-04 18:56:37 +00:00
Steve Bavin
018de3591c Slightly simpler mechanism to avoid Q_AUDIO_FILL_BUFFER floods.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16497 a1c6a512-1295-4272-9138-f99709370657
2008-03-03 12:01:29 +00:00
Steve Bavin
bda6f573da Fix odd behaviour when rebuffering occurs during playback. This is 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-29 23:27:55 +00:00
Michael Sevakis
f38274f2f9 Use a safe way to get pcm buffer track change notifications to the audio thread.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16450 a1c6a512-1295-4272-9138-f99709370657
2008-02-28 22:37:46 +00:00
Magnus Holmgren
00b722ff22 Fix bookmark resume when a track is playing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16445 a1c6a512-1295-4272-9138-f99709370657
2008-02-28 17:40:31 +00:00
Nicolas Pennequin
3987166a0a Fix auto dir change happening one track too early (another followup of r16425).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16430 a1c6a512-1295-4272-9138-f99709370657
2008-02-26 20:29:52 +00:00
Nicolas Pennequin
a36dbaa2c4 Fix not being able to skip to the last track in a playlist.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16426 a1c6a512-1295-4272-9138-f99709370657
2008-02-26 17:55:18 +00:00
Nicolas Pennequin
b834e25d71 Attempt to make manual track skips more responsive and more robust
* 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-26 17:15:35 +00:00
Nicolas Pennequin
f730133e04 Factor out duplicate code from audio_prev and audio_next
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16424 a1c6a512-1295-4272-9138-f99709370657
2008-02-26 17:15:33 +00:00
Nicolas Pennequin
ea9e02b442 Make audio_next_track use the wps_offset value.
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-26 17:15:30 +00:00
Magnus Holmgren
68f9e6bfee When starting playback, prevent the codec from starting to decode too early, 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-02-23 17:46:33 +00:00
Nicolas Pennequin
ca243ce494 Fix FS#5797 (Codec failure with directory skip when in file browser, with 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-09 20:37:36 +00:00
Nicolas Pennequin
659fe5a35b Fix FS#6215 (player crashes after trying to resume deleted music file). As 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-08 23:48:51 +00:00
Brandon Low
5fd859b68a Take out some no longer needed (and overly complicated) comments, thanks to Nico_P
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16027 a1c6a512-1295-4272-9138-f99709370657
2008-01-08 18:26:17 +00:00
Nicolas Pennequin
3d7f64c615 Fix FS#2687 (Rewinding at end of song confuses playback) by making the codec 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-08 14:29:11 +00:00
Nicolas Pennequin
d5b96f5e16 Make the playlist index be incremented after the PCM track change. This 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
2008-01-07 22:05:58 +00:00
Brandon Low
3386dd7be9 Fix FS8069, because Nico_P made it easy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15840 a1c6a512-1295-4272-9138-f99709370657
2007-11-28 04:58:16 +00:00
Nicolas Pennequin
e24454f8b3 Buffering callbacks rework. There is now one callback for all the events 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-26 21:13:08 +00:00
Dan Everton
d7e1f77146 Commit FS#7440. The iPod Video doesn't actually have a hardware equalizer. 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-24 07:51:00 +00:00
Robert Kukla
a334bd2891 revise commit r15463 - we still get the immediate display of runtime data in 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-23 23:36:42 +00:00
Robert Kukla
5ee2e372f5 Save runtime info for last track in playlist as well (FS#8040)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15767 a1c6a512-1295-4272-9138-f99709370657
2007-11-23 01:09:49 +00:00
Nicolas Pennequin
c44d2bd4cb Fix FS#8201 and correct fix for FS#8040 by making the track unbuffer 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-22 00:20:37 +00:00
Michael Sevakis
398d9fd8b4 Hopefully the last word on getting rid of yield_codecs loops (cut read chunk 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-20 22:45:46 +00:00
Michael Sevakis
fadbf0a6f7 Make threads responsible for explicit cancellation of their own boosted 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-20 03:44:25 +00:00
Nicolas Pennequin
2ff513237d Fix FS#8040 (Gather Runtime Data not working) the right way. Also a few cosmetic changes and comments.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15696 a1c6a512-1295-4272-9138-f99709370657
2007-11-19 17:30:46 +00:00
Nicolas Pennequin
d3b8245ca8 Second part of FS#8104 by Bertrik Sikken: Simplification of 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-19 16:37:52 +00:00
Nicolas Pennequin
cfa6495356 First part of FS#8104 by Bertrik Sikken: Simplification and consistency 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-19 15:52:25 +00:00
Michael Sevakis
4f2473db6c Do the wait for the audio thread init in such a way to avoid an unlikely but 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-19 13:26:46 +00:00
Michael Sevakis
d6f2a54654 Make sure initial menu item is voiced at startup. Voice thread must wait for 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-19 11:59:52 +00:00
Michael Sevakis
99617d71ba Make speex the new voice format for SWCODEC targets (non-Archos). Remove 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-18 17:12:19 +00:00
Nicolas Pennequin
9446226276 Erase lasttrack_id3 when end-of-playlist is reached. Fixes FS#8148.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15659 a1c6a512-1295-4272-9138-f99709370657
2007-11-18 13:41:04 +00:00
Brandon Low
d1c6d53962 I'm a retard, this is definitely more correct
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15627 a1c6a512-1295-4272-9138-f99709370657
2007-11-14 22:34:32 +00:00
Brandon Low
02467cffa0 Might fix FS#8158, I was unable to reproduce so no guarantee.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15626 a1c6a512-1295-4272-9138-f99709370657
2007-11-14 22:29:26 +00:00
Nicolas Pennequin
4963925767 Fix another NULL pointer dereference crash.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15591 a1c6a512-1295-4272-9138-f99709370657
2007-11-12 00:17:55 +00:00
Nicolas Pennequin
e71bc67d94 Fix an issue that appeared in r15577, where skipping back to a track that 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-11 21:27:18 +00:00
Nicolas Pennequin
95db8f8022 Load the album art before the codec because find_albumart would yield to the 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 20:09:13 +00:00
Nicolas Pennequin
496027d8bb * Make the album art be updated on PCM track change, not codec track change (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-11 15:50:52 +00:00
Nicolas Pennequin
cf37f4c079 Fix red.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15573 a1c6a512-1295-4272-9138-f99709370657
2007-11-11 12:52:07 +00:00
Nicolas Pennequin
9d4bed7ff0 Album art support. Based on FS#3045, but heavily modified to adapt to MoB 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-11 12:29:37 +00:00
Nicolas Pennequin
a677678e31 Fix a possible NULL pointer dereference I introduced in r15503 by making an 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-10 18:22:55 +00:00
Nicolas Pennequin
941600f121 Remove nexttrack_id3 and instead use the metadata present on the buffer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15540 a1c6a512-1295-4272-9138-f99709370657
2007-11-08 17:27:43 +00:00
Nicolas Pennequin
12d479fd3e Store the metadata of the first unbuffered track in a static struct so that 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
2007-11-08 16:52:29 +00:00
Nicolas Pennequin
fbdc0e6b57 Fix warning.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15504 a1c6a512-1295-4272-9138-f99709370657
2007-11-07 01:10:53 +00:00
Nicolas Pennequin
5f7d21dfa0 Fix tracks always being cleared on skip (reported by dionoea). The problem was that skipping the ID3 info from the beginning caused the offset to always be nonzero.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15503 a1c6a512-1295-4272-9138-f99709370657
2007-11-07 00:59:42 +00:00
Brandon Low
405380e57f Don't keep resetting to default watermark during buffering, only do it once at play start
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15485 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 18:54:22 +00:00
Nicolas Pennequin
aef008b061 Set all track handles to -1 on audio init to avoid calling bufclose(0) on all of them on the first playback stop. This also revealed a bug in audio_release_tracks where it wouldn't release all the tracks because the wrong #define value was used.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15484 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 18:46:25 +00:00
Nicolas Pennequin
6631e36fa7 Fix some logf warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15483 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 18:19:38 +00:00
Brandon Low
3379440a4b Remove conf_filechunk, it should never have been a setting and its implementation doesn't do what it claims any way
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15478 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 17:48:21 +00:00
Brandon Low
1df1e7b0c7 Remove unused conf_preseek from buffering.c and all of its accountraments. This is _not_ a setting. This is a guessing tool used by either playback or buffering to serve its clients better. Use the REBUFFER_GUESS size in resume to help obviate pondlife's bug. This will also need to be used when FS8092 gets fixed correctly with a complete rebuffer for backward movements. It may also belong in buffering not playback, haven't decided for sure
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15475 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 16:02:12 +00:00
Brandon Low
d02b5c744e Don't keep useless id3v2 or other leading tag data on the buffer, it could be large
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15465 a1c6a512-1295-4272-9138-f99709370657
2007-11-05 01:56:12 +00:00
Brandon Low
31c1164c49 make handle_id of zero valid, stop using memsets to clear tracks, should be no functional changes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15462 a1c6a512-1295-4272-9138-f99709370657
2007-11-04 19:01:02 +00:00
Brandon Low
f906498786 OTher part of previous
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15450 a1c6a512-1295-4272-9138-f99709370657
2007-11-04 05:36:35 +00:00
Brandon Low
e8fa7f94b0 More attempt to fix 8077
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15449 a1c6a512-1295-4272-9138-f99709370657
2007-11-04 05:33:06 +00:00
Brandon Low
0c97493a88 This part was good, bring it back
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15440 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 21:55:24 +00:00
Brandon Low
c2e1cc1e39 Revert recent changes that are broken
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15439 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 21:48:08 +00:00
Brandon Low
acb3e9af22 Make handle id semantics more like file id. This may need to be revisited if we ever start storing long lived things on the buffer (if an item lives through 32k other items coming and going, there will be an id collision and things will break)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15437 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 21:13:15 +00:00
Brandon Low
86919f4609 Misc. buffering related playback tweaks
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15435 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 17:55:29 +00:00
Brandon Low
11a3661d73 Make atomic type work for even first track. Rework low buffer handling... uses a stateful variable because I'm a bitter old man and it works this way
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15425 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 06:21:32 +00:00
Michael Sevakis
4bce3ad98a Use the correct event state constants.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15423 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 05:14:09 +00:00
Brandon Low
9c3c6f9c82 Logf when a file is loaded atomic not packet
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15420 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 04:30:43 +00:00
Brandon Low
9a114614d5 Comments and a fix to possibly get more out of backward skipping without rebuffering
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15413 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 02:53:57 +00:00
Nicolas Pennequin
b838a62adf Make bufread and bufgetdata blocking. They now return when enough data is available or when EOF is reached. This improves the API and removes the need for several duplicate waiting loops.
Also fix a few logfqueue messages.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15412 a1c6a512-1295-4272-9138-f99709370657
2007-11-02 19:13:03 +00:00