avformat/subfile: allow to extract till EOF
Users can set end offset as 0 to extract till end of file. Tested locally and documented.
This commit is contained in:
parent
4f4e19914d
commit
e75fe0ef21
@ -1186,6 +1186,7 @@ Accepted options:
|
|||||||
Start offset of the extracted segment, in bytes.
|
Start offset of the extracted segment, in bytes.
|
||||||
@item end
|
@item end
|
||||||
End offset of the extracted segment, in bytes.
|
End offset of the extracted segment, in bytes.
|
||||||
|
If set to 0, extract till end of file.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
@ -1201,6 +1202,11 @@ Play an AVI file directly from a TAR archive:
|
|||||||
subfile,,start,183241728,end,366490624,,:archive.tar
|
subfile,,start,183241728,end,366490624,,:archive.tar
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
Play a MPEG-TS file from start offset till end:
|
||||||
|
@example
|
||||||
|
subfile,,start,32815239,end,0,,:video.ts
|
||||||
|
@end example
|
||||||
|
|
||||||
@section tee
|
@section tee
|
||||||
|
|
||||||
Writes the output to multiple protocols. The individual outputs are separated
|
Writes the output to multiple protocols. The individual outputs are separated
|
||||||
|
@ -72,6 +72,9 @@ static int subfile_open(URLContext *h, const char *filename, int flags,
|
|||||||
SubfileContext *c = h->priv_data;
|
SubfileContext *c = h->priv_data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (!c->end)
|
||||||
|
c->end = INT64_MAX;
|
||||||
|
|
||||||
if (c->end <= c->start) {
|
if (c->end <= c->start) {
|
||||||
av_log(h, AV_LOG_ERROR, "end before start\n");
|
av_log(h, AV_LOG_ERROR, "end before start\n");
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user