}
+#ifdef CONFIG_ENCODERS
static void flush_buffer(ByteIOContext *s)
{
if (s->buf_ptr > s->buffer) {
flush_buffer(s);
s->must_flush = 0;
}
+#endif //CONFIG_ENCODERS
offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence)
{
if (whence != SEEK_CUR && whence != SEEK_SET)
return -EINVAL;
+#ifdef CONFIG_ENCODERS
if (s->write_flag) {
if (whence == SEEK_CUR) {
offset1 = s->pos + (s->buf_ptr - s->buffer);
s->seek(s->opaque, offset, SEEK_SET);
s->pos = offset;
}
- } else {
+ } else
+#endif //CONFIG_ENCODERS
+ {
if (whence == SEEK_CUR) {
offset1 = s->pos - (s->buf_end - s->buffer) + (s->buf_ptr - s->buffer);
if (offset == 0)
return s->eof_reached;
}
+#ifdef CONFIG_ENCODERS
void put_le32(ByteIOContext *s, unsigned int val)
{
put_byte(s, val);
put_byte(s, *tag++);
}
}
+#endif //CONFIG_ENCODERS
/* Input stream */
/* link with avio functions */
+#ifdef CONFIG_ENCODERS
static void url_write_packet(void *opaque, uint8_t *buf, int buf_size)
{
URLContext *h = opaque;
url_write(h, buf, buf_size);
}
+#else
+#define url_write_packet NULL
+#endif //CONFIG_ENCODERS
static int url_read_packet(void *opaque, uint8_t *buf, int buf_size)
{
return s->opaque;
}
+#ifdef CONFIG_ENCODERS
/* XXX: currently size is limited */
int url_fprintf(ByteIOContext *s, const char *fmt, ...)
{
put_buffer(s, buf, strlen(buf));
return ret;
}
+#endif //CONFIG_ENCODERS
/* note: unlike fgets, the EOL character is not returned and a whole
line is parsed. return NULL if first char read was EOF */
return s->max_packet_size;
}
+#ifdef CONFIG_ENCODERS
/* buffer handling */
int url_open_buf(ByteIOContext *s, uint8_t *buf, int buf_size, int flags)
{
av_free(d);
return size;
}
+#endif //CONFIG_ENCODERS