Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
6797af80
Commit
6797af80
authored
Jan 27, 2014
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat mux: transmit Opus extradata in the expected format
(Only the OpusHead packet, no OpusTags)
parent
ee3cd25b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
3 deletions
+28
-3
modules/demux/avformat/mux.c
modules/demux/avformat/mux.c
+28
-3
No files found.
modules/demux/avformat/mux.c
View file @
6797af80
...
...
@@ -38,6 +38,7 @@
#include "avformat.h"
#include "../../codec/avcodec/avcodec.h"
#include "../../codec/avcodec/avcommon.h"
#include "../xiph.h"
//#define AVFORMAT_DEBUG 1
...
...
@@ -181,6 +182,21 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
return
VLC_EGENERIC
;
}
unsigned
opus_size
[
XIPH_MAX_HEADER_COUNT
];
void
*
opus_packet
[
XIPH_MAX_HEADER_COUNT
];
if
(
fmt
->
i_codec
==
VLC_CODEC_OPUS
)
{
unsigned
count
;
/* Only transmits the first packet (OpusHead) */
if
(
xiph_SplitHeaders
(
opus_size
,
opus_packet
,
&
count
,
fmt
->
i_extra
,
fmt
->
p_extra
)
)
{
count
=
0
;
}
if
(
count
!=
2
||
opus_size
[
0
]
<
19
)
{
msg_Err
(
p_mux
,
"Invalid Opus header"
);
return
VLC_EGENERIC
;
}
}
p_input
->
p_sys
=
malloc
(
sizeof
(
int
)
);
*
((
int
*
)
p_input
->
p_sys
)
=
p_sys
->
oc
->
nb_streams
;
...
...
@@ -243,11 +259,20 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
codec
->
codec_id
=
i_codec_id
;
if
(
fmt
->
i_extra
)
{
if
(
fmt
->
i_codec
==
VLC_CODEC_OPUS
)
{
codec
->
extradata_size
=
opus_size
[
0
];
codec
->
extradata
=
av_malloc
(
opus_size
[
0
]
);
memcpy
(
codec
->
extradata
,
opus_packet
[
0
],
opus_size
[
0
]
);
}
else
{
codec
->
extradata_size
=
fmt
->
i_extra
;
codec
->
extradata
=
av_malloc
(
fmt
->
i_extra
);
memcpy
(
codec
->
extradata
,
fmt
->
p_extra
,
fmt
->
i_extra
);
}
}
return
VLC_SUCCESS
;
}
...
...
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