Mercurial > libavformat.hg
comparison flvdec.c @ 1562:61df6b5d52d3 libavformat
use amf_get_string()
author | michael |
---|---|
date | Sun, 10 Dec 2006 17:38:16 +0000 |
parents | a21addc40d10 |
children | bf3589ba8d7e |
comparison
equal
deleted
inserted
replaced
1561:a21addc40d10 | 1562:61df6b5d52d3 |
---|---|
133 while(url_ftell(&s->pb) + 5 < next){ | 133 while(url_ftell(&s->pb) + 5 < next){ |
134 char tmp[128]; | 134 char tmp[128]; |
135 int type, len; | 135 int type, len; |
136 double d= 0; | 136 double d= 0; |
137 | 137 |
138 len= get_be16(&s->pb); | 138 if(amf_get_string(&s->pb, tmp, sizeof(tmp))<0) |
139 if(len >= sizeof(tmp) || !len) | |
140 break; | 139 break; |
141 get_buffer(&s->pb, tmp, len); | |
142 tmp[len]=0; | |
143 | 140 |
144 type= get_byte(&s->pb); | 141 type= get_byte(&s->pb); |
145 if(type == AMF_DATA_TYPE_NUMBER){ | 142 if(type == AMF_DATA_TYPE_NUMBER){ |
146 d= av_int2dbl(get_be64(&s->pb)); | 143 d= av_int2dbl(get_be64(&s->pb)); |
147 }else if(type == AMF_DATA_TYPE_STRING){ | 144 }else if(type == AMF_DATA_TYPE_STRING){ |
148 len= get_be16(&s->pb); | 145 amf_get_string(&s->pb, NULL, 0); |
149 if(len >= sizeof(tmp)) | |
150 break; | |
151 url_fskip(&s->pb, len); | |
152 }else if(type == AMF_DATA_TYPE_MIXEDARRAY){ | 146 }else if(type == AMF_DATA_TYPE_MIXEDARRAY){ |
153 //array | 147 //array |
154 break; | 148 break; |
155 }else if(type == AMF_DATA_TYPE_DATE){ | 149 }else if(type == AMF_DATA_TYPE_DATE){ |
156 d= av_int2dbl(get_be64(&s->pb)); | 150 d= av_int2dbl(get_be64(&s->pb)); |