Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
91b66e27
Commit
91b66e27
authored
Mar 18, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opus: fix duration signedness
parent
7e4ce224
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
modules/demux/ogg.c
modules/demux/ogg.c
+4
-4
modules/demux/opus.h
modules/demux/opus.h
+6
-6
No files found.
modules/demux/ogg.c
View file @
91b66e27
...
...
@@ -123,7 +123,7 @@ static int Control( demux_t *, int, va_list );
static
int
Ogg_ReadPage
(
demux_t
*
,
ogg_page
*
);
static
void
Ogg_UpdatePCR
(
demux_t
*
,
logical_stream_t
*
,
ogg_packet
*
);
static
void
Ogg_DecodePacket
(
demux_t
*
,
logical_stream_t
*
,
ogg_packet
*
);
static
int
Ogg_OpusPacketDuration
(
ogg_packet
*
);
static
unsigned
Ogg_OpusPacketDuration
(
ogg_packet
*
);
static
void
Ogg_SendOrQueueBlocks
(
demux_t
*
,
logical_stream_t
*
,
block_t
*
);
static
void
Ogg_CreateES
(
demux_t
*
p_demux
);
...
...
@@ -990,7 +990,7 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
if
(
p_stream
->
fmt
.
i_codec
==
VLC_CODEC_OPUS
&&
p_oggpacket
->
e_o_s
)
{
int
duration
=
Ogg_OpusPacketDuration
(
p_oggpacket
);
unsigned
duration
=
Ogg_OpusPacketDuration
(
p_oggpacket
);
if
(
duration
>
0
)
{
ogg_int64_t
end_sample
=
p_oggpacket
->
granulepos
;
...
...
@@ -1011,7 +1011,7 @@ static void Ogg_UpdatePCR( demux_t *p_demux, logical_stream_t *p_stream,
}
else
if
(
p_oggpacket
->
granulepos
==
-
1
)
{
int
i_duration
;
unsigned
i_duration
;
/* no granulepos available, try to interpolate the pcr.
* If we can't then don't touch the old value. */
if
(
p_stream
->
fmt
.
i_cat
==
VIDEO_ES
&&
p_stream
->
i_pcr
>
VLC_TS_INVALID
)
...
...
@@ -1460,7 +1460,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
Ogg_SendOrQueueBlocks
(
p_demux
,
p_stream
,
p_block
);
}
static
int
Ogg_OpusPacketDuration
(
ogg_packet
*
p_oggpacket
)
static
unsigned
Ogg_OpusPacketDuration
(
ogg_packet
*
p_oggpacket
)
{
return
opus_frame_duration
(
p_oggpacket
->
packet
,
p_oggpacket
->
bytes
);
}
...
...
modules/demux/opus.h
View file @
91b66e27
...
...
@@ -23,14 +23,14 @@
/* Returns Opus frame duration in samples */
static
inline
int
opus_frame_duration
(
unsigned
char
*
data
,
long
len
)
static
inline
unsigned
opus_frame_duration
(
unsigned
char
*
data
,
long
len
)
{
static
const
int
silk_fs_div
[
4
]
=
{
6000
,
3000
,
1500
,
1000
};
int
toc
;
int
nframes
;
int
frame_size
;
int
nsamples
;
int
i_rate
;
unsigned
toc
;
unsigned
nframes
;
unsigned
frame_size
;
unsigned
nsamples
;
unsigned
i_rate
;
if
(
len
<
1
)
return
0
;
toc
=
data
[
0
];
...
...
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