comparison flvdec.c @ 1560:f59b66f9d679 libavformat

amf_get_string() by Allan Hsu allan aat counterpop doot net
author michael
date Sun, 10 Dec 2006 17:31:17 +0000
parents 515e80ef01e6
children a21addc40d10
comparison
equal deleted inserted replaced
1559:515e80ef01e6 1560:f59b66f9d679
36 d = p->buf; 36 d = p->buf;
37 if (d[0] == 'F' && d[1] == 'L' && d[2] == 'V') { 37 if (d[0] == 'F' && d[1] == 'L' && d[2] == 'V') {
38 return 50; 38 return 50;
39 } 39 }
40 return 0; 40 return 0;
41 }
42
43 static int amf_get_string(ByteIOContext *ioc, char *buffer, int buffsize) {
44 int length;
45
46 length = get_be16(ioc);
47 if(length >= buffsize) {
48 url_fskip(ioc, length);
49 return -1; //string will not fit in buffer
50 }
51
52 get_buffer(ioc, buffer, length);
53
54 buffer[length] = '\0';
55
56 return length;
41 } 57 }
42 58
43 static int flv_read_header(AVFormatContext *s, 59 static int flv_read_header(AVFormatContext *s,
44 AVFormatParameters *ap) 60 AVFormatParameters *ap)
45 { 61 {