Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
faf149d0
Commit
faf149d0
authored
Jan 31, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/xiph/OggVisitor: add method ReadGranulepos()
parent
e01bbad7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
OggVisitor.cxx
src/lib/xiph/OggVisitor.cxx
+11
-0
OggVisitor.hxx
src/lib/xiph/OggVisitor.hxx
+16
-0
No files found.
src/lib/xiph/OggVisitor.cxx
View file @
faf149d0
...
...
@@ -108,3 +108,14 @@ OggVisitor::PostSeek(uint64_t offset)
post_seek
=
true
;
}
ogg_int64_t
OggVisitor
::
ReadGranulepos
()
noexcept
{
ogg_packet
packet
;
while
(
stream
.
PacketOut
(
packet
)
==
1
)
if
(
packet
.
granulepos
>=
0
)
return
packet
.
granulepos
;
return
-
1
;
}
src/lib/xiph/OggVisitor.hxx
View file @
faf149d0
...
...
@@ -66,6 +66,22 @@ public:
*/
void
PostSeek
(
uint64_t
offset
);
/**
* Skip packets (#ogg_packet) from the #OggStreamState until a
* packet with a valid granulepos is found or until the stream
* has run dry.
*
* Since this will discard pending packets and will disturb
* this object, this should only be used while seeking.
*
* This method must not be called from within one of the
* virtual methods.
*
* @return the granulepos or -1 if no valid granulepos was
* found
*/
ogg_int64_t
ReadGranulepos
()
noexcept
;
private
:
void
EndStream
();
bool
ReadNextPage
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment