Handle a couple of special AVSEEK_ seek modes
This commit is contained in:
parent
d4670faafd
commit
c59bbe7c22
@ -94,6 +94,7 @@ static int64_t MemData_seek(void *opaque, int64_t offset, int whence)
|
|||||||
{
|
{
|
||||||
struct MemData *membuf = (struct MemData*)opaque;
|
struct MemData *membuf = (struct MemData*)opaque;
|
||||||
|
|
||||||
|
whence &= ~AVSEEK_FORCE;
|
||||||
switch(whence)
|
switch(whence)
|
||||||
{
|
{
|
||||||
case SEEK_SET:
|
case SEEK_SET:
|
||||||
@ -115,6 +116,9 @@ static int64_t MemData_seek(void *opaque, int64_t offset, int whence)
|
|||||||
membuf->pos = membuf->length + offset;
|
membuf->pos = membuf->length + offset;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case AVSEEK_SIZE:
|
||||||
|
return membuf->length;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user