forked from len0rd/rockbox
Initial implementation of audio support (44.1KHz only, mp2 or mp3, mono/stereo, any bitrate) and .mpg file (MPEG program stream) parsing for mpegplayer - .m2v files are no longer supported. .mpg parser based on patch #6366 from Mathieu Favreaux. Currently limited to only playing files smaller than the available buffer RAM (it will play longer files, but never refills the buffer when it runs empty). There is also no a/v sync implemented, and still no seeking support. Coldfire (iriver H3x0 and iaudio X5) users can use the optimisations provided in patch #5995 to increase the framerate, and PortalPlayer (ipods and iriver H10) users will want to use kernel_on_cop_6.diff from FS#5755 which enables mpegplayer to run the video thread on the second CPU core - video on the second core with audio on the first core runs at the same speed as the old mpegplayer did with no audio.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11877 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
718ffdeada
commit
4b801b2d3a
7 changed files with 715 additions and 79 deletions
|
@ -46,6 +46,7 @@ void * mpeg2_malloc (unsigned size, mpeg2_alloc_t reason)
|
|||
|
||||
(void)reason;
|
||||
|
||||
DEBUGF("mpeg2_malloc(%d,%d)\n",size,reason);
|
||||
if (mem_ptr + (long)size > bufsize) {
|
||||
DEBUGF("OUT OF MEMORY\n");
|
||||
return NULL;
|
||||
|
@ -74,3 +75,45 @@ void *memcpy(void *dest, const void *src, size_t n) {
|
|||
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
||||
/* The following are expected by libmad */
|
||||
void* codec_malloc(size_t size)
|
||||
{
|
||||
return mpeg2_malloc(size,-3);
|
||||
}
|
||||
|
||||
void* codec_calloc(size_t nmemb, size_t size)
|
||||
{
|
||||
void* ptr;
|
||||
|
||||
ptr = mpeg2_malloc(nmemb*size,-3);
|
||||
|
||||
if (ptr)
|
||||
rb->memset(ptr,0,size);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void codec_free(void* ptr) {
|
||||
(void)ptr;
|
||||
}
|
||||
|
||||
void *memmove(void *dest, const void *src, size_t n)
|
||||
{
|
||||
return rb->memmove(dest,src,n);
|
||||
}
|
||||
|
||||
void *memset(void *s, int c, size_t n)
|
||||
{
|
||||
return rb->memset(s,c,n);
|
||||
}
|
||||
|
||||
void abort(void)
|
||||
{
|
||||
rb->lcd_putsxy(0,0,"ABORT!");
|
||||
rb->lcd_update();
|
||||
|
||||
while (1);
|
||||
/* Let's hope this is never called */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue