diff options
Diffstat (limited to 'libavformat/sauce.c')
-rw-r--r-- | libavformat/sauce.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libavformat/sauce.c b/libavformat/sauce.c index 32c026cd34..e861b14e16 100644 --- a/libavformat/sauce.c +++ b/libavformat/sauce.c @@ -36,13 +36,13 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g uint64_t start_pos = url_fsize(pb) - 128; url_fseek(pb, start_pos, SEEK_SET); - if (get_buffer(pb, buf, 7) != 7) + if (avio_read(pb, buf, 7) != 7) return -1; if (memcmp(buf, "SAUCE00", 7)) return -1; #define GET_SAUCE_META(name,size) \ - if (get_buffer(pb, buf, size) == size && buf[0]) { \ + if (avio_read(pb, buf, size) == size && buf[0]) { \ buf[size] = 0; \ av_metadata_set2(&avctx->metadata, name, buf, 0); \ } @@ -52,12 +52,12 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g GET_SAUCE_META("publisher", 20) GET_SAUCE_META("date", 8) url_fskip(pb, 4); - datatype = get_byte(pb); - filetype = get_byte(pb); - t1 = get_le16(pb); - t2 = get_le16(pb); - nb_comments = get_byte(pb); - flags = get_byte(pb); + datatype = avio_r8(pb); + filetype = avio_r8(pb); + t1 = avio_rl16(pb); + t2 = avio_rl16(pb); + nb_comments = avio_r8(pb); + flags = avio_r8(pb); url_fskip(pb, 4); GET_SAUCE_META("encoder", 22); @@ -83,14 +83,14 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g if (nb_comments > 0) { url_fseek(pb, start_pos - 64*nb_comments - 5, SEEK_SET); - if (get_buffer(pb, buf, 5) == 5 && !memcmp(buf, "COMNT", 5)) { + if (avio_read(pb, buf, 5) == 5 && !memcmp(buf, "COMNT", 5)) { int i; char *str = av_malloc(65*nb_comments + 1); *fsize -= 64*nb_comments + 5; if (!str) return 0; for (i = 0; i < nb_comments; i++) { - if (get_buffer(pb, str + 65*i, 64) != 64) + if (avio_read(pb, str + 65*i, 64) != 64) break; str[65*i + 64] = '\n'; } |