2310
|
1
|
|
2 #include <stdio.h>
|
|
3 #include <stdlib.h>
|
|
4 #include <string.h>
|
|
5
|
|
6 #include "mp_msg.h"
|
|
7
|
|
8 #include "stream.h"
|
|
9 #include "demuxer.h"
|
|
10 #include "stheader.h"
|
|
11
|
|
12 //--------------------------
|
|
13
|
|
14 // audio stream skip/resync functions requires only for seeking.
|
|
15 // (they should be implemented in the audio codec layer)
|
|
16 void skip_audio_frame(sh_audio_t *sh_audio){
|
|
17 }
|
|
18 void resync_audio_stream(sh_audio_t *sh_audio){
|
|
19 }
|
|
20
|
2322
|
21 int verbose=5; // must be global!
|
2310
|
22
|
|
23 //---------------
|
|
24
|
|
25 extern stream_t* open_stream(char* filename,int vcd_track,int* file_format);
|
|
26
|
|
27 int main(int argc,char* argv[]){
|
|
28
|
|
29 stream_t* stream=NULL;
|
|
30 demuxer_t* demuxer=NULL;
|
|
31 int file_format=DEMUXER_TYPE_UNKNOWN;
|
|
32
|
|
33 mp_msg_init(verbose+MSGL_STATUS);
|
|
34
|
|
35 if(argc>1)
|
|
36 stream=open_stream(argv[1],0,&file_format);
|
|
37 else
|
|
38 // stream=open_stream("/3d/divx/405divx_sm_v2[1].avi",0,&file_format);
|
|
39 stream=open_stream("/dev/cdrom",2,&file_format); // VCD track 2
|
|
40
|
|
41 if(!stream){
|
|
42 printf("Cannot open file/device\n");
|
|
43 exit(1);
|
|
44 }
|
2322
|
45
|
2310
|
46 printf("success: format: %d data: 0x%X - 0x%X\n",file_format, (int)(stream->start_pos),(int)(stream->end_pos));
|
|
47
|
2322
|
48 stream_enable_cache(stream,2048*1024);
|
|
49
|
2310
|
50 demuxer=demux_open(stream,file_format,-1,-1,-1);
|
|
51 if(!demuxer){
|
|
52 printf("Cannot open demuxer\n");
|
|
53 exit(1);
|
|
54 }
|
|
55
|
|
56
|
|
57 }
|