comparison recpt1/decoder.c @ 4:43d177fa65c9

fixed indentation
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 17 Feb 2009 01:46:54 +0900
parents 8ac7c59fefc9
children 97fd2315114e
comparison
equal deleted inserted replaced
3:6801fe7e04ff 4:43d177fa65c9
3 #include "decoder.h" 3 #include "decoder.h"
4 4
5 decoder * 5 decoder *
6 b25_startup(void) 6 b25_startup(void)
7 { 7 {
8 decoder *dec = calloc(1, sizeof(decoder)); 8 decoder *dec = calloc(1, sizeof(decoder));
9 int code; 9 int code;
10 10
11 dec->b25 = create_arib_std_b25(); 11 dec->b25 = create_arib_std_b25();
12 dec->b25->set_multi2_round(dec->b25, 4); //xxx round should be configurable 12 dec->b25->set_multi2_round(dec->b25, 4); //xxx round should be configurable
13 dec->b25->set_strip(dec->b25, 0); //ditto 13 dec->b25->set_strip(dec->b25, 0); //ditto
14 dec->b25->set_emm_proc(dec->b25, 0); //ditto 14 dec->b25->set_emm_proc(dec->b25, 0); //ditto
15 dec->bcas = create_b_cas_card(); 15 dec->bcas = create_b_cas_card();
16 code = dec->bcas->init(dec->bcas); 16 code = dec->bcas->init(dec->bcas);
17 code = dec->b25->set_b_cas_card(dec->b25, dec->bcas); 17 code = dec->b25->set_b_cas_card(dec->b25, dec->bcas);
18 18
19 return dec; 19 return dec;
20 } 20 }
21 21
22 int 22 int
23 b25_shutdown(decoder *dec) 23 b25_shutdown(decoder *dec)
24 { 24 {
25 dec->b25->release(dec->b25); 25 dec->b25->release(dec->b25);
26 dec->bcas->release(dec->bcas); 26 dec->bcas->release(dec->bcas);
27 free(dec); 27 free(dec);
28 28
29 return 0; 29 return 0;
30 } 30 }
31 31
32 int 32 int
33 b25_decode(decoder *dec, ARIB_STD_B25_BUFFER *sbuf, ARIB_STD_B25_BUFFER *dbuf) 33 b25_decode(decoder *dec, ARIB_STD_B25_BUFFER *sbuf, ARIB_STD_B25_BUFFER *dbuf)
34 { 34 {
35 int code; 35 int code;
36 36
37 code = dec->b25->put(dec->b25, sbuf); 37 code = dec->b25->put(dec->b25, sbuf);
38 if(code < 0) 38 if(code < 0)
39 return code;
40
41 code = dec->b25->get(dec->b25, dbuf);
39 return code; 42 return code;
40
41 code = dec->b25->get(dec->b25, dbuf);
42 return code;
43 } 43 }
44 44
45 int 45 int
46 b25_finish(decoder *dec, ARIB_STD_B25_BUFFER *sbuf, ARIB_STD_B25_BUFFER *dbuf) 46 b25_finish(decoder *dec, ARIB_STD_B25_BUFFER *sbuf, ARIB_STD_B25_BUFFER *dbuf)
47 { 47 {
48 int code; 48 int code;
49 49
50 code = dec->b25->flush(dec->b25); 50 code = dec->b25->flush(dec->b25);
51 if(code < 0) 51 if(code < 0)
52 return code;
53
54 code = dec->b25->get(dec->b25, dbuf);
52 return code; 55 return code;
53
54 code = dec->b25->get(dec->b25, dbuf);
55 return code;
56 } 56 }