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
181edf4b
Commit
181edf4b
authored
Aug 18, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InputStream: make offset_type unsigned
parent
dfa53cb8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
14 deletions
+5
-14
OpusDecoderPlugin.cxx
src/decoder/plugins/OpusDecoderPlugin.cxx
+0
-3
AsyncInputStream.cxx
src/input/AsyncInputStream.cxx
+0
-3
InputStream.hxx
src/input/InputStream.hxx
+1
-4
CdioParanoiaInputPlugin.cxx
src/input/plugins/CdioParanoiaInputPlugin.cxx
+1
-1
FileInputPlugin.cxx
src/input/plugins/FileInputPlugin.cxx
+3
-3
No files found.
src/decoder/plugins/OpusDecoderPlugin.cxx
View file @
181edf4b
...
...
@@ -187,8 +187,6 @@ LoadEOSPacket(InputStream &is, Decoder *decoder, int serialno,
return
-
1
;
const
auto
old_offset
=
is
.
GetOffset
();
if
(
old_offset
<
0
)
return
-
1
;
/* create temporary Ogg objects for seeking and parsing the
EOS packet */
...
...
@@ -335,7 +333,6 @@ MPDOpusDecoder::Seek(OggSyncState &oy, double where_s)
assert
(
eos_granulepos
>
0
);
assert
(
input_stream
.
IsSeekable
());
assert
(
input_stream
.
KnownSize
());
assert
(
input_stream
.
GetOffset
()
>=
0
);
const
ogg_int64_t
where_granulepos
(
where_s
*
opus_sample_rate
);
...
...
src/input/AsyncInputStream.cxx
View file @
181edf4b
...
...
@@ -116,9 +116,6 @@ AsyncInputStream::Seek(offset_type new_offset, Error &error)
if
(
!
IsSeekable
())
return
false
;
if
(
new_offset
<
0
)
return
false
;
/* check if we can fast-forward the buffer */
while
(
new_offset
>
offset
)
{
...
...
src/input/InputStream.hxx
View file @
181edf4b
...
...
@@ -35,7 +35,7 @@ struct Tag;
class
InputStream
{
public
:
typedef
int64_t
offset_type
;
typedef
u
int64_t
offset_type
;
private
:
/**
...
...
@@ -236,8 +236,6 @@ public:
void
AddOffset
(
offset_type
delta
)
{
assert
(
ready
);
assert
(
offset
>=
0
);
assert
(
delta
>=
0
);
offset
+=
delta
;
}
...
...
@@ -253,7 +251,6 @@ public:
offset_type
GetRest
()
const
{
assert
(
ready
);
assert
(
KnownSize
());
assert
(
offset
>=
0
);
return
size
-
offset
;
}
...
...
src/input/plugins/CdioParanoiaInputPlugin.cxx
View file @
181edf4b
...
...
@@ -274,7 +274,7 @@ input_cdio_open(const char *uri,
bool
CdioParanoiaInputStream
::
Seek
(
offset_type
new_offset
,
Error
&
error
)
{
if
(
new_offset
<
0
||
new_offset
>
size
)
{
if
(
new_offset
>
size
)
{
error
.
Format
(
cdio_domain
,
"Invalid offset to seek %ld (%ld)"
,
(
long
int
)
new_offset
,
(
long
int
)
size
);
return
false
;
...
...
src/input/plugins/FileInputPlugin.cxx
View file @
181edf4b
...
...
@@ -101,13 +101,13 @@ input_file_open(const char *filename,
bool
FileInputStream
::
Seek
(
offset_type
new_offset
,
Error
&
error
)
{
new_offset
=
(
offset_type
)
lseek
(
fd
,
(
off_t
)
new_offset
,
SEEK_SET
);
if
(
new_offse
t
<
0
)
{
auto
result
=
lseek
(
fd
,
(
off_t
)
new_offset
,
SEEK_SET
);
if
(
resul
t
<
0
)
{
error
.
SetErrno
(
"Failed to seek"
);
return
false
;
}
offset
=
new_offse
t
;
offset
=
(
offset_type
)
resul
t
;
return
true
;
}
...
...
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