~ubuntu-branches/ubuntu/lucid/mpg123/lucid

« back to all changes in this revision

Viewing changes to mpglib/main.c

Tags: upstream-0.60
ImportĀ upstreamĀ versionĀ 0.60

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
#include "mpg123.h"
3
 
#include "mpglib.h"
4
 
 
5
 
char buf[16384];
6
 
struct mpstr mp;
7
 
 
8
 
void main(void)
9
 
{
10
 
        int size;
11
 
        char out[8192];
12
 
        int len,ret;
13
 
        
14
 
 
15
 
        InitMP3(&mp);
16
 
 
17
 
        while(1) {
18
 
                len = read(0,buf,16384);
19
 
                if(len <= 0)
20
 
                        break;
21
 
                ret = decodeMP3(&mp,buf,len,out,8192,&size);
22
 
                while(ret == MP3_OK) {
23
 
                        write(1,out,size);
24
 
                        ret = decodeMP3(&mp,NULL,0,out,8192,&size);
25
 
                }
26
 
        }
27
 
 
28
 
}
29