Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
23f741f7
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
23f741f7
编写于
5月 26, 2014
作者:
A
Anton Khirnov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
matroskadec: parse the channel layout mask for FLAC
It is commonly stored in a vorbiscomment block in codec private data.
上级
4efdadc8
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
53 addition
and
12 deletion
+53
-12
libavformat/Makefile
libavformat/Makefile
+2
-1
libavformat/flacdec.c
libavformat/flacdec.c
+1
-1
libavformat/matroskadec.c
libavformat/matroskadec.c
+38
-0
libavformat/oggdec.h
libavformat/oggdec.h
+2
-1
libavformat/oggparsecelt.c
libavformat/oggparsecelt.c
+1
-1
libavformat/oggparseflac.c
libavformat/oggparseflac.c
+1
-1
libavformat/oggparseogm.c
libavformat/oggparseogm.c
+1
-1
libavformat/oggparseopus.c
libavformat/oggparseopus.c
+1
-1
libavformat/oggparsespeex.c
libavformat/oggparsespeex.c
+1
-1
libavformat/oggparsetheora.c
libavformat/oggparsetheora.c
+1
-1
libavformat/oggparsevorbis.c
libavformat/oggparsevorbis.c
+4
-3
未找到文件。
libavformat/Makefile
浏览文件 @
23f741f7
...
...
@@ -166,7 +166,8 @@ OBJS-$(CONFIG_LXF_DEMUXER) += lxfdec.o
OBJS-$(CONFIG_M4V_DEMUXER)
+=
m4vdec.o rawdec.o
OBJS-$(CONFIG_M4V_MUXER)
+=
rawenc.o
OBJS-$(CONFIG_MATROSKA_DEMUXER)
+=
matroskadec.o matroska.o
\
isom.o rmsipr.o
isom.o rmsipr.o
\
oggparsevorbis.o vorbiscomment.o
OBJS-$(CONFIG_MATROSKA_MUXER)
+=
matroskaenc.o matroska.o
\
isom.o avc.o hevc.o
\
flacenc_header.o avlanguage.o wv.o
...
...
libavformat/flacdec.c
浏览文件 @
23f741f7
...
...
@@ -141,7 +141,7 @@ static int flac_read_header(AVFormatContext *s)
if
(
metadata_type
==
FLAC_METADATA_TYPE_VORBIS_COMMENT
)
{
AVDictionaryEntry
*
chmask
;
if
(
ff_vorbis_comment
(
s
,
&
s
->
metadata
,
buffer
,
metadata_size
))
{
if
(
ff_vorbis_comment
(
s
,
&
s
->
metadata
,
buffer
,
metadata_size
,
1
))
{
av_log
(
s
,
AV_LOG_WARNING
,
"error parsing VorbisComment metadata
\n
"
);
}
...
...
libavformat/matroskadec.c
浏览文件 @
23f741f7
...
...
@@ -55,6 +55,7 @@
#include "internal.h"
#include "isom.h"
#include "matroska.h"
#include "oggdec.h"
/* For ff_codec_get_id(). */
#include "riff.h"
#include "rmsipr.h"
...
...
@@ -1443,6 +1444,7 @@ static int matroska_parse_flac(AVFormatContext *s,
MatroskaTrack
*
track
,
int
*
offset
)
{
AVStream
*
st
=
track
->
stream
;
uint8_t
*
p
=
track
->
codec_priv
.
data
;
int
size
=
track
->
codec_priv
.
size
;
...
...
@@ -1454,6 +1456,42 @@ static int matroska_parse_flac(AVFormatContext *s,
*
offset
=
8
;
track
->
codec_priv
.
size
=
8
+
FLAC_STREAMINFO_SIZE
;
p
+=
track
->
codec_priv
.
size
;
size
-=
track
->
codec_priv
.
size
;
/* parse the remaining metadata blocks if present */
while
(
size
>=
4
)
{
int
block_last
,
block_type
,
block_size
;
flac_parse_block_header
(
p
,
&
block_last
,
&
block_type
,
&
block_size
);
p
+=
4
;
size
-=
4
;
if
(
block_size
>
size
)
return
0
;
/* check for the channel mask */
if
(
block_type
==
FLAC_METADATA_TYPE_VORBIS_COMMENT
)
{
AVDictionary
*
dict
=
NULL
;
AVDictionaryEntry
*
chmask
;
ff_vorbis_comment
(
s
,
&
dict
,
p
,
block_size
,
0
);
chmask
=
av_dict_get
(
dict
,
"WAVEFORMATEXTENSIBLE_CHANNEL_MASK"
,
NULL
,
0
);
if
(
chmask
)
{
uint64_t
mask
=
strtol
(
chmask
->
value
,
NULL
,
0
);
if
(
!
mask
||
mask
&
~
0x3ffffULL
)
{
av_log
(
s
,
AV_LOG_WARNING
,
"Invalid value of WAVEFORMATEXTENSIBLE_CHANNEL_MASK
\n
"
);
}
else
st
->
codec
->
channel_layout
=
mask
;
}
av_dict_free
(
&
dict
);
}
p
+=
block_size
;
size
-=
block_size
;
}
return
0
;
}
...
...
libavformat/oggdec.h
浏览文件 @
23f741f7
...
...
@@ -122,7 +122,8 @@ extern const struct ogg_codec ff_speex_codec;
extern
const
struct
ogg_codec
ff_theora_codec
;
extern
const
struct
ogg_codec
ff_vorbis_codec
;
int
ff_vorbis_comment
(
AVFormatContext
*
ms
,
AVDictionary
**
m
,
const
uint8_t
*
buf
,
int
size
);
int
ff_vorbis_comment
(
AVFormatContext
*
ms
,
AVDictionary
**
m
,
const
uint8_t
*
buf
,
int
size
,
int
parse_picture
);
static
inline
int
ogg_find_stream
(
struct
ogg
*
ogg
,
int
serial
)
...
...
libavformat/oggparsecelt.c
浏览文件 @
23f741f7
...
...
@@ -81,7 +81,7 @@ static int celt_header(AVFormatContext *s, int idx)
}
else
if
(
priv
&&
priv
->
extra_headers_left
)
{
/* Extra headers (vorbiscomment) */
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
p
,
os
->
psize
);
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
p
,
os
->
psize
,
1
);
priv
->
extra_headers_left
--
;
return
1
;
}
else
{
...
...
libavformat/oggparseflac.c
浏览文件 @
23f741f7
...
...
@@ -69,7 +69,7 @@ flac_header (AVFormatContext * s, int idx)
avpriv_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
}
else
if
(
mdt
==
FLAC_METADATA_TYPE_VORBIS_COMMENT
)
{
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
os
->
buf
+
os
->
pstart
+
4
,
os
->
psize
-
4
);
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
os
->
buf
+
os
->
pstart
+
4
,
os
->
psize
-
4
,
1
);
}
return
1
;
...
...
libavformat/oggparseogm.c
浏览文件 @
23f741f7
...
...
@@ -97,7 +97,7 @@ ogm_header(AVFormatContext *s, int idx)
}
else
if
(
bytestream2_peek_byte
(
&
p
)
==
3
)
{
bytestream2_skip
(
&
p
,
7
);
if
(
bytestream2_get_bytes_left
(
&
p
)
>
1
)
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
p
.
buffer
,
bytestream2_get_bytes_left
(
&
p
)
-
1
);
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
p
.
buffer
,
bytestream2_get_bytes_left
(
&
p
)
-
1
,
1
);
}
return
1
;
...
...
libavformat/oggparseopus.c
浏览文件 @
23f741f7
...
...
@@ -74,7 +74,7 @@ static int opus_header(AVFormatContext *avf, int idx)
if
(
priv
->
need_comments
)
{
if
(
os
->
psize
<
8
||
memcmp
(
packet
,
"OpusTags"
,
8
))
return
AVERROR_INVALIDDATA
;
ff_vorbis_comment
(
avf
,
&
st
->
metadata
,
packet
+
8
,
os
->
psize
-
8
);
ff_vorbis_comment
(
avf
,
&
st
->
metadata
,
packet
+
8
,
os
->
psize
-
8
,
1
);
priv
->
need_comments
--
;
return
1
;
}
...
...
libavformat/oggparsespeex.c
浏览文件 @
23f741f7
...
...
@@ -79,7 +79,7 @@ static int speex_header(AVFormatContext *s, int idx) {
avpriv_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
}
else
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
p
,
os
->
psize
);
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
p
,
os
->
psize
,
1
);
spxp
->
seq
++
;
return
1
;
...
...
libavformat/oggparsetheora.c
浏览文件 @
23f741f7
...
...
@@ -116,7 +116,7 @@ static int theora_header(AVFormatContext *s, int idx)
}
break
;
case
0x81
:
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
os
->
buf
+
os
->
pstart
+
7
,
os
->
psize
-
7
);
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
os
->
buf
+
os
->
pstart
+
7
,
os
->
psize
-
7
,
1
);
case
0x82
:
if
(
!
thp
->
version
)
return
AVERROR_INVALIDDATA
;
...
...
libavformat/oggparsevorbis.c
浏览文件 @
23f741f7
...
...
@@ -72,7 +72,8 @@ static int ogm_chapter(AVFormatContext *as, uint8_t *key, uint8_t *val)
}
int
ff_vorbis_comment
(
AVFormatContext
*
as
,
AVDictionary
**
m
,
const
uint8_t
*
buf
,
int
size
)
const
uint8_t
*
buf
,
int
size
,
int
parse_picture
)
{
const
uint8_t
*
p
=
buf
;
const
uint8_t
*
end
=
buf
+
size
;
...
...
@@ -137,7 +138,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
* 'METADATA_BLOCK_PICTURE'. This is the preferred and
* recommended way of embedding cover art within VorbisComments."
*/
if
(
!
strcmp
(
tt
,
"METADATA_BLOCK_PICTURE"
))
{
if
(
!
strcmp
(
tt
,
"METADATA_BLOCK_PICTURE"
)
&&
parse_picture
)
{
int
ret
;
char
*
pict
=
av_malloc
(
vl
);
...
...
@@ -305,7 +306,7 @@ static int vorbis_header(AVFormatContext *s, int idx)
}
else
if
(
os
->
buf
[
os
->
pstart
]
==
3
)
{
if
(
os
->
psize
>
8
&&
ff_vorbis_comment
(
s
,
&
st
->
metadata
,
os
->
buf
+
os
->
pstart
+
7
,
os
->
psize
-
8
)
>=
0
)
{
os
->
psize
-
8
,
1
)
>=
0
)
{
unsigned
new_len
;
int
ret
=
ff_replaygain_export
(
st
,
st
->
metadata
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录