Handle a couple of special AVSEEK_ seek modes

This commit is contained in:
Chris Robinson 2012-01-11 00:32:16 -08:00
parent d4670faafd
commit c59bbe7c22

View File

@ -94,6 +94,7 @@ static int64_t MemData_seek(void *opaque, int64_t offset, int whence)
{
struct MemData *membuf = (struct MemData*)opaque;
whence &= ~AVSEEK_FORCE;
switch(whence)
{
case SEEK_SET:
@ -115,6 +116,9 @@ static int64_t MemData_seek(void *opaque, int64_t offset, int whence)
membuf->pos = membuf->length + offset;
break;
case AVSEEK_SIZE:
return membuf->length;
default:
return -1;
}