36 int datatype, filetype,
t1,
t2, nb_comments;
42 if (memcmp(buf,
"SAUCE00", 7))
45 #define GET_SAUCE_META(name,size) \
46 if (avio_read(pb, buf, size) == size && buf[0]) { \
48 av_dict_set(&avctx->metadata, name, buf, 0); \
65 if (got_width && datatype && filetype) {
66 if ((datatype == 1 && filetype <=2) || (datatype == 5 && filetype == 255) || datatype == 6) {
73 }
else if (datatype == 5) {
85 if (nb_comments > 0) {
86 avio_seek(pb, start_pos - 64*nb_comments - 5, SEEK_SET);
87 if (
avio_read(pb, buf, 5) == 5 && !memcmp(buf,
"COMNT", 5)) {
89 char *str =
av_malloc(65*nb_comments + 1);
90 *fsize -= 64*nb_comments + 5;
93 for (i = 0; i < nb_comments; i++) {
96 str[65*i + 64] =
'\n';
int64_t avio_size(AVIOContext *s)
Get the filesize.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
AVStream ** streams
A list of all streams in the file.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
AVDictionary * metadata
Metadata that applies to the whole file.
int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int get_height)
int avio_r8(AVIOContext *s)
AVCodecContext * codec
Codec context associated with this stream.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
int width
picture width / height.
AVIOContext * pb
I/O context.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define GET_SAUCE_META(name, size)
unsigned int avio_rl16(AVIOContext *s)
static int get_height(const FieldMatchContext *fm, const AVFrame *f, int plane)