Commit 7000a175 authored by Michael Niedermayer's avatar Michael Niedermayer

SCR timestamp fix try #1

Originally committed as revision 3550 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent d8b5abfa
......@@ -524,6 +524,7 @@ void fifo_free(FifoBuffer *f);
int fifo_size(FifoBuffer *f, uint8_t *rptr);
int fifo_read(FifoBuffer *f, uint8_t *buf, int buf_size, uint8_t **rptr_ptr);
void fifo_write(FifoBuffer *f, uint8_t *buf, int size, uint8_t **wptr_ptr);
int put_fifo(ByteIOContext *pb, FifoBuffer *f, int buf_size, uint8_t **rptr_ptr);
/* media file input */
AVInputFormat *av_find_input_format(const char *short_name);
......
This diff is collapsed.
......@@ -264,6 +264,34 @@ void fifo_write(FifoBuffer *f, uint8_t *buf, int size, uint8_t **wptr_ptr)
*wptr_ptr = wptr;
}
/* get data from the fifo (return -1 if not enough data) */
int put_fifo(ByteIOContext *pb, FifoBuffer *f, int buf_size, uint8_t **rptr_ptr)
{
uint8_t *rptr = *rptr_ptr;
int size, len;
if (f->wptr >= rptr) {
size = f->wptr - rptr;
} else {
size = (f->end - rptr) + (f->wptr - f->buffer);
}
if (size < buf_size)
return -1;
while (buf_size > 0) {
len = f->end - rptr;
if (len > buf_size)
len = buf_size;
put_buffer(pb, rptr, len);
rptr += len;
if (rptr >= f->end)
rptr = f->buffer;
buf_size -= len;
}
*rptr_ptr = rptr;
return 0;
}
int filename_number_test(const char *filename)
{
char buf[1024];
......
......@@ -7,9 +7,9 @@ ffmpeg regression test
./data/b-libav.asf CRC=750f18c7
1cbf838e659d7fc3d3e33f4187b91f6c *./data/b-libav.rm
360251 ./data/b-libav.rm
e0a9ed22a34e0277ec77c84e8b64afd9 *./data/b-libav.mpg
82d8794cc5eaf220b2f260ceacaf3a3b *./data/b-libav.mpg
387072 ./data/b-libav.mpg
./data/b-libav.mpg CRC=c0b64225
./data/b-libav.mpg CRC=16c74225
57a8dfc7926802bb337a9d8918de94a8 *./data/b-libav.swf
41816 ./data/b-libav.swf
./data/b-libav.swf CRC=2b273fea
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment