Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
云duo
FFmpeg
提交
4a0f6651
F
FFmpeg
项目概览
云duo
/
FFmpeg
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
FFmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4a0f6651
编写于
2月 19, 2014
作者:
A
Anton Khirnov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libavcodec: when decoding, copy replaygain side data to decoded frames
上级
5a7e35dd
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
43 addition
and
9 deletion
+43
-9
libavcodec/internal.h
libavcodec/internal.h
+5
-0
libavcodec/rawdec.c
libavcodec/rawdec.c
+4
-2
libavcodec/utils.c
libavcodec/utils.c
+34
-7
未找到文件。
libavcodec/internal.h
浏览文件 @
4a0f6651
...
...
@@ -186,4 +186,9 @@ int ff_set_dimensions(AVCodecContext *s, int width, int height);
int
ff_side_data_update_matrix_encoding
(
AVFrame
*
frame
,
enum
AVMatrixEncoding
matrix_encoding
);
/**
* Set various frame properties from the codec context / packet data.
*/
int
ff_decode_frame_props
(
AVCodecContext
*
avctx
,
AVFrame
*
frame
);
#endif
/* AVCODEC_INTERNAL_H */
libavcodec/rawdec.c
浏览文件 @
4a0f6651
...
...
@@ -150,8 +150,10 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
frame
->
pict_type
=
AV_PICTURE_TYPE_I
;
frame
->
key_frame
=
1
;
frame
->
reordered_opaque
=
avctx
->
reordered_opaque
;
frame
->
pkt_pts
=
avctx
->
internal
->
pkt
->
pts
;
res
=
ff_decode_frame_props
(
avctx
,
frame
);
if
(
res
<
0
)
return
res
;
if
(
buf_size
<
context
->
frame_size
-
(
avctx
->
pix_fmt
==
AV_PIX_FMT_PAL8
?
AVPALETTE_SIZE
:
0
))
...
...
libavcodec/utils.c
浏览文件 @
4a0f6651
...
...
@@ -572,6 +572,35 @@ static void compat_release_buffer(void *opaque, uint8_t *data)
FF_ENABLE_DEPRECATION_WARNINGS
#endif
int
ff_decode_frame_props
(
AVCodecContext
*
avctx
,
AVFrame
*
frame
)
{
AVPacket
*
pkt
=
avctx
->
internal
->
pkt
;
uint8_t
*
packet_sd
;
int
size
;
AVFrameSideData
*
frame_sd
;
frame
->
reordered_opaque
=
avctx
->
reordered_opaque
;
if
(
!
pkt
)
{
frame
->
pkt_pts
=
AV_NOPTS_VALUE
;
return
0
;
}
frame
->
pkt_pts
=
pkt
->
pts
;
/* copy the replaygain data to the output frame */
packet_sd
=
av_packet_get_side_data
(
pkt
,
AV_PKT_DATA_REPLAYGAIN
,
&
size
);
if
(
packet_sd
)
{
frame_sd
=
av_frame_new_side_data
(
frame
,
AV_FRAME_DATA_REPLAYGAIN
,
size
);
if
(
!
frame_sd
)
return
AVERROR
(
ENOMEM
);
memcpy
(
frame_sd
->
data
,
packet_sd
,
size
);
}
return
0
;
}
int
ff_get_buffer
(
AVCodecContext
*
avctx
,
AVFrame
*
frame
,
int
flags
)
{
int
override_dimensions
=
1
;
...
...
@@ -623,8 +652,9 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
default:
return
AVERROR
(
EINVAL
);
}
frame
->
pkt_pts
=
avctx
->
internal
->
pkt
?
avctx
->
internal
->
pkt
->
pts
:
AV_NOPTS_VALUE
;
frame
->
reordered_opaque
=
avctx
->
reordered_opaque
;
ret
=
ff_decode_frame_props
(
avctx
,
frame
);
if
(
ret
<
0
)
return
ret
;
#if FF_API_GET_BUFFER
FF_DISABLE_DEPRECATION_WARNINGS
...
...
@@ -762,11 +792,8 @@ int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
if
(
!
frame
->
data
[
0
])
return
ff_get_buffer
(
avctx
,
frame
,
AV_GET_BUFFER_FLAG_REF
);
if
(
av_frame_is_writable
(
frame
))
{
frame
->
pkt_pts
=
avctx
->
internal
->
pkt
?
avctx
->
internal
->
pkt
->
pts
:
AV_NOPTS_VALUE
;
frame
->
reordered_opaque
=
avctx
->
reordered_opaque
;
return
0
;
}
if
(
av_frame_is_writable
(
frame
))
return
ff_decode_frame_props
(
avctx
,
frame
);
tmp
=
av_frame_alloc
();
if
(
!
tmp
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录