Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
d76f581f
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,发现更多精彩内容 >>
提交
d76f581f
编写于
4月 04, 2004
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
kill obnoxious ogg_packet passing from demuxer to decoder
Originally committed as revision 2953 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
8bfed902
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
7 deletion
+11
-7
libavcodec/oggvorbis.c
libavcodec/oggvorbis.c
+8
-3
libavformat/ogg.c
libavformat/ogg.c
+3
-4
未找到文件。
libavcodec/oggvorbis.c
浏览文件 @
d76f581f
...
...
@@ -19,6 +19,7 @@ typedef struct OggVorbisContext {
/* decoder */
vorbis_comment
vc
;
ogg_packet
op
;
}
OggVorbisContext
;
...
...
@@ -146,6 +147,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) {
vorbis_info_init
(
&
context
->
vi
)
;
vorbis_comment_init
(
&
context
->
vc
)
;
context
->
op
.
packetno
=
0
;
return
0
;
}
...
...
@@ -181,8 +183,8 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext,
uint8_t
*
buf
,
int
buf_size
)
{
OggVorbisContext
*
context
=
avccontext
->
priv_data
;
ogg_packet
*
op
=
(
ogg_packet
*
)
buf
;
float
**
pcm
;
ogg_packet
*
op
=
&
context
->
op
;
int
samples
,
total_samples
,
total_bytes
,
i
;
if
(
!
buf_size
){
...
...
@@ -191,14 +193,15 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext,
return
0
;
}
op
->
packet
=
(
char
*
)
op
+
sizeof
(
ogg_packet
)
;
/* correct data pointer */
op
->
packet
=
buf
;
op
->
bytes
=
buf_size
;
op
->
b_o_s
=
op
->
packetno
==
0
;
// av_log(avccontext, AV_LOG_DEBUG, "%d %d %d %lld %lld %d %d\n", op->bytes, op->b_o_s, op->e_o_s, op->granulepos, op->packetno, buf_size, context->vi.rate);
/* for(i=0; i<op->bytes; i++)
av_log(avccontext, AV_LOG_DEBUG, "%02X ", op->packet[i]);
av_log(avccontext, AV_LOG_DEBUG, "\n");*/
// op->b_o_s= op->packetno == 0;
if
(
op
->
packetno
<
3
)
{
if
(
vorbis_synthesis_headerin
(
&
context
->
vi
,
&
context
->
vc
,
op
)
<
0
){
av_log
(
avccontext
,
AV_LOG_ERROR
,
"%lld. vorbis header damaged
\n
"
,
op
->
packetno
+
1
);
...
...
@@ -206,6 +209,7 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext,
}
avccontext
->
channels
=
context
->
vi
.
channels
;
avccontext
->
sample_rate
=
context
->
vi
.
rate
;
op
->
packetno
++
;
return
buf_size
;
}
...
...
@@ -230,6 +234,7 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext,
vorbis_synthesis_read
(
&
context
->
vd
,
samples
)
;
}
op
->
packetno
++
;
*
data_size
=
total_bytes
;
return
buf_size
;
}
...
...
libavformat/ogg.c
浏览文件 @
d76f581f
...
...
@@ -226,13 +226,12 @@ static int ogg_read_packet(AVFormatContext *avfcontext, AVPacket *pkt) {
if
(
next_packet
(
avfcontext
,
&
op
))
return
-
EIO
;
if
(
av_new_packet
(
pkt
,
sizeof
(
ogg_packet
)
+
op
.
bytes
)
<
0
)
if
(
av_new_packet
(
pkt
,
op
.
bytes
)
<
0
)
return
-
EIO
;
pkt
->
stream_index
=
0
;
memcpy
(
pkt
->
data
,
&
op
,
sizeof
(
ogg_packet
))
;
memcpy
(
pkt
->
data
+
sizeof
(
ogg_packet
),
op
.
packet
,
op
.
bytes
)
;
memcpy
(
pkt
->
data
,
op
.
packet
,
op
.
bytes
);
return
sizeof
(
ogg_packet
)
+
op
.
bytes
;
return
op
.
bytes
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录