Revision 773947ba
libavformat/avio.h | ||
---|---|---|
548 | 548 |
int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen); |
549 | 549 |
int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen); |
550 | 550 |
|
551 |
char *get_strz(AVIOContext *s, char *buf, int maxlen); |
|
551 |
#if FF_API_OLD_AVIO |
|
552 |
/** |
|
553 |
* @deprecated use avio_get_str instead |
|
554 |
*/ |
|
555 |
attribute_deprecated char *get_strz(AVIOContext *s, char *buf, int maxlen); |
|
556 |
#endif |
|
552 | 557 |
unsigned int avio_rb16(AVIOContext *s); |
553 | 558 |
unsigned int avio_rb24(AVIOContext *s); |
554 | 559 |
unsigned int avio_rb32(AVIOContext *s); |
libavformat/aviobuf.c | ||
---|---|---|
675 | 675 |
return val; |
676 | 676 |
} |
677 | 677 |
|
678 |
#if FF_API_OLD_AVIO |
|
678 | 679 |
char *get_strz(AVIOContext *s, char *buf, int maxlen) |
679 | 680 |
{ |
680 |
int i = 0; |
|
681 |
char c; |
|
682 |
|
|
683 |
while ((c = avio_r8(s))) { |
|
684 |
if (i < maxlen-1) |
|
685 |
buf[i++] = c; |
|
686 |
} |
|
687 |
|
|
688 |
buf[i] = 0; /* Ensure null terminated, but may be truncated */ |
|
689 |
|
|
681 |
avio_get_str(s, INT_MAX, buf, maxlen); |
|
690 | 682 |
return buf; |
691 | 683 |
} |
684 |
#endif |
|
692 | 685 |
|
693 | 686 |
int ff_get_line(AVIOContext *s, char *buf, int maxlen) |
694 | 687 |
{ |
libavformat/cafdec.c | ||
---|---|---|
185 | 185 |
for (i = 0; i < nb_entries; i++) { |
186 | 186 |
char key[32]; |
187 | 187 |
char value[1024]; |
188 |
get_strz(pb, key, sizeof(key));
|
|
189 |
get_strz(pb, value, sizeof(value));
|
|
188 |
avio_get_str(pb, INT_MAX, key, sizeof(key));
|
|
189 |
avio_get_str(pb, INT_MAX, value, sizeof(value));
|
|
190 | 190 |
av_metadata_set2(&s->metadata, key, value, 0); |
191 | 191 |
} |
192 | 192 |
} |
libavformat/ffmdec.c | ||
---|---|---|
325 | 325 |
codec->qcompress = avio_rb16(pb) / 10000.0; |
326 | 326 |
codec->qblur = avio_rb16(pb) / 10000.0; |
327 | 327 |
codec->bit_rate_tolerance = avio_rb32(pb); |
328 |
codec->rc_eq = av_strdup(get_strz(pb, rc_eq_buf, sizeof(rc_eq_buf))); |
|
328 |
avio_get_str(pb, INT_MAX, rc_eq_buf, sizeof(rc_eq_buf)); |
|
329 |
codec->rc_eq = av_strdup(rc_eq_buf); |
|
329 | 330 |
codec->rc_max_rate = avio_rb32(pb); |
330 | 331 |
codec->rc_min_rate = avio_rb32(pb); |
331 | 332 |
codec->rc_buffer_size = avio_rb32(pb); |
libavformat/mov.c | ||
---|---|---|
2331 | 2331 |
avio_get_str16le(sc->pb, len, title, title_len); |
2332 | 2332 |
else { |
2333 | 2333 |
AV_WB16(title, ch); |
2334 |
get_strz(sc->pb, title + 2, len - 1);
|
|
2334 |
avio_get_str(sc->pb, len - 2, title + 2, title_len - 2);
|
|
2335 | 2335 |
} |
2336 | 2336 |
|
2337 | 2337 |
ff_new_chapter(s, i, st->time_base, sample->timestamp, end, title); |
Also available in: Unified diff