Enlightenment CVS committal

Author  : tsauerbeck
Project : misc
Module  : eplayer

Dir     : misc/eplayer/src


Modified Files:
        plugin.h track.c 


Log Message:
Added libavcodec input plugin (yeah, this means you will finally be able to listen to 
your mp3s using eplayer)
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/plugin.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- plugin.h    23 Oct 2003 17:01:49 -0000      1.1
+++ plugin.h    24 Oct 2003 11:38:48 -0000      1.2
@@ -29,7 +29,7 @@
        int (*get_channels)();
        int (*get_sample_rate)();
        
-       int (*read)(unsigned char *buf, int len, int bigendian);
+       int (*read)(unsigned char *buf, int len);
 
        int (*get_current_pos)();
        void (*set_current_pos)(int pos);
@@ -41,7 +41,7 @@
        void (*shutdown)();
 
        /* playback */
-       int (*configure)(int channels, int rate, int bits, int bigendian);
+       int (*configure)(int channels, int rate, int bits);
        int (*play)(unsigned char *data, int len);
 
        /* mixer */
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/track.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- track.c     23 Oct 2003 17:01:49 -0000      1.1
+++ track.c     24 Oct 2003 11:38:48 -0000      1.2
@@ -10,29 +10,25 @@
  * @param udata Pointer to an ePlayer struct.
  */
 int track_play_chunk(void *udata) {
+#define BUF_SIZE 18432
        ePlayer *player = udata;
        PlayListItem *pli = player->playlist->cur_item->data;
        InputPlugin *plugin = pli->plugin;
-       int bytes_read, big_endian = 0;
-       static unsigned char pcmout[8192];
+       int read;
+       static unsigned char pcmout[BUF_SIZE];
 
-#ifdef WORDS_BIGENDIAN
-       big_endian = 1;
-#endif
-       
        /* read the data ... */
-       bytes_read = plugin->read(pcmout, sizeof(pcmout), big_endian);
-       
-       if (bytes_read) /* ...and play it */
-               player->output->play(pcmout, bytes_read);
-       else /* EOF -> move to the next track */
+       if ((read = plugin->read(pcmout, BUF_SIZE))) {
+               /* ...and play it */
+               player->output->play(pcmout, read);
+       } else /* EOF -> move to the next track */
                edje_object_signal_emit(player->gui.edje,
                                        "PLAY_NEXT", "next_button");
 
        /* the edje callback will re-add the idler, so we can remove it here,
         * in case ov_read() failed
         */
-       return !!bytes_read;
+       return !!read;
 }
 
 int track_update_time(void *udata) {
@@ -57,15 +53,9 @@
 
 static int prepare_output(ePlayer *player) {
        PlayListItem *current = player->playlist->cur_item->data;
-       int bigendian = 0;
-
-#ifdef WORDS_BIGENDIAN
-       bigendian = 1;
-#endif
 
        return player->output->configure(current->channels,
-                                        current->sample_rate,
-                                        16, bigendian);
+                                        current->sample_rate, 16);
 }
 
 /**




-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to