Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
ffmpeg2theora
Commits
fe8e04fb
Commit
fe8e04fb
authored
Jan 29, 2012
by
Jan Gerber
Browse files
use ffmpeg 0.10 api
parent
26bb7747
Changes
3
Hide whitespace changes
Inline
Side-by-side
SConstruct
View file @
fe8e04fb
...
...
@@ -151,6 +151,7 @@ if not env.GetOption('clean'):
"libavcodec >= 52.30.0"
,
"libpostproc"
,
"libswscale"
,
"libswresample"
,
"libavutil"
,
]
if
os
.
path
.
exists
(
"./ffmpeg"
):
...
...
src/avinfo.c
View file @
fe8e04fb
...
...
@@ -390,7 +390,7 @@ int _json_metadata(FILE *output, AVDictionary *m, int first, int indent)
{
int
i
=
0
;
AVDictionaryEntry
*
tag
=
NULL
;
while
((
tag
=
av_dict_get
(
m
,
""
,
tag
,
AV_
METADATA
_IGNORE_SUFFIX
)))
{
while
((
tag
=
av_dict_get
(
m
,
""
,
tag
,
AV_
DICT
_IGNORE_SUFFIX
)))
{
if
(
strlen
(
tag
->
value
)
&&
utf8_validate
(
tag
->
value
,
strlen
(
tag
->
value
)))
{
if
(
first
)
{
first
=
0
;
...
...
src/ffmpeg2theora.c
View file @
fe8e04fb
...
...
@@ -522,8 +522,8 @@ void ff2theora_output(ff2theora this) {
AVStream
*
vstream
=
NULL
;
AVCodec
*
acodec
=
NULL
;
AVCodec
*
vcodec
=
NULL
;
pp_mode
_t
*
ppMode
=
NULL
;
pp_context
_t
*
ppContext
=
NULL
;
pp_mode
*
ppMode
=
NULL
;
pp_context
*
ppContext
=
NULL
;
int
sws_flags
=
this
->
resize_method
;
float
frame_aspect
=
0
;
double
fps
=
0
.
0
;
...
...
@@ -958,11 +958,11 @@ void ff2theora_output(ff2theora this) {
if
(
acodec
!=
NULL
&&
avcodec_open2
(
aenc
,
acodec
,
NULL
)
>=
0
)
{
if
(
this
->
sample_rate
!=
sample_rate
||
this
->
channels
!=
aenc
->
channels
||
aenc
->
sample_fmt
!=
SAMPLE_FMT_S16
)
{
||
aenc
->
sample_fmt
!=
AV_
SAMPLE_FMT_S16
)
{
// values take from libavcodec/resample.c
this
->
audio_resample_ctx
=
av_audio_resample_init
(
this
->
channels
,
aenc
->
channels
,
this
->
sample_rate
,
sample_rate
,
SAMPLE_FMT_S16
,
aenc
->
sample_fmt
,
AV_
SAMPLE_FMT_S16
,
aenc
->
sample_fmt
,
16
,
10
,
0
,
0
.
8
);
if
(
!
this
->
audio_resample_ctx
)
{
this
->
channels
=
aenc
->
channels
;
...
...
@@ -1925,7 +1925,7 @@ void copy_metadata(const AVFormatContext *av)
"AUTHOR"
};
AVDictionaryEntry
*
tag
=
NULL
;
while
((
tag
=
av_dict_get
(
av
->
metadata
,
""
,
tag
,
AV_
METADATA
_IGNORE_SUFFIX
)))
{
while
((
tag
=
av_dict_get
(
av
->
metadata
,
""
,
tag
,
AV_
DICT
_IGNORE_SUFFIX
)))
{
char
uc_key
[
16
];
int
i
;
for
(
i
=
0
;
tag
->
key
[
i
]
!=
'\0'
&&
i
<
LENGTH
(
uc_key
)
-
1
;
i
++
)
...
...
@@ -2843,7 +2843,7 @@ int main(int argc, char **argv) {
}
}
if
(
avformat_open_input
(
&
convert
->
context
,
inputfile_name
,
input_fmt
,
&
format_opts
)
>=
0
)
{
if
(
av_find_stream_info
(
convert
->
context
)
>=
0
)
{
if
(
av
format
_find_stream_info
(
convert
->
context
,
NULL
)
>=
0
)
{
if
(
output_filename_needs_building
)
{
int
i
;
...
...
@@ -2970,7 +2970,7 @@ int main(int argc, char **argv) {
fprintf
(
stderr
,
"
\n
Unable to decode input.
\n
"
);
return
(
1
);
}
av_close_input
_file
(
convert
->
context
);
av
format
_close_input
(
&
convert
->
context
);
}
else
{
if
(
info
.
frontend
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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