mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-13 02:41:37 +00:00
Merge remote-tracking branch 'qatar/master'
* qatar/master:
avconv: fix some bugs introduced in 630902a1e1
libmp3lame: fix typo
AVOptions: drop av_ prefix from static av_get_number().
libx264: use X264_THREADS_AUTO constant instead of 0.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
58677d73ed
6
avconv.c
6
avconv.c
@ -1891,13 +1891,13 @@ static int init_input_stream(int ist_index, OutputStream *output_streams, int nb
|
||||
if (ist->decoding_needed) {
|
||||
AVCodec *codec = ist->dec;
|
||||
if (!codec) {
|
||||
snprintf(error, sizeof(error), "Decoder (codec id %d) not found for input stream #%d.%d",
|
||||
snprintf(error, error_len, "Decoder (codec id %d) not found for input stream #%d.%d",
|
||||
ist->st->codec->codec_id, ist->file_index, ist->st->index);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (avcodec_open2(ist->st->codec, codec, &ist->opts) < 0) {
|
||||
snprintf(error, sizeof(error), "Error while opening decoder for input stream #%d.%d",
|
||||
snprintf(error, error_len, "Error while opening decoder for input stream #%d.%d",
|
||||
ist->file_index, ist->st->index);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
@ -2203,7 +2203,7 @@ static int transcode_init(OutputFile *output_files,
|
||||
|
||||
/* init input streams */
|
||||
for (i = 0; i < nb_input_streams; i++)
|
||||
if ((ret = init_input_stream(i, output_streams, nb_output_streams, error, sizeof(error)) < 0))
|
||||
if ((ret = init_input_stream(i, output_streams, nb_output_streams, error, sizeof(error))) < 0)
|
||||
goto dump_format;
|
||||
|
||||
/* open files and write file headers */
|
||||
|
@ -72,7 +72,7 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx)
|
||||
lame_set_VBR_quality(s->gfp, avctx->global_quality/(float)FF_QP2LAMBDA);
|
||||
}
|
||||
lame_set_bWriteVbrTag(s->gfp,0);
|
||||
#if FF_API_LAME_GLOBAL_OPTIONS
|
||||
#if FF_API_LAME_GLOBAL_OPTS
|
||||
s->reservoir = avctx->flags2 & CODEC_FLAG2_BIT_RESERVOIR;
|
||||
#endif
|
||||
lame_set_disable_reservoir(s->gfp, !s->reservoir);
|
||||
|
@ -548,7 +548,7 @@ static const AVClass class = {
|
||||
|
||||
static const AVCodecDefault x264_defaults[] = {
|
||||
{ "b", "0" },
|
||||
{ "threads", "0" },
|
||||
{ "threads", AV_STRINGIFY(X264_THREADS_AUTO) },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
@ -260,7 +260,7 @@ const char *av_get_string(void *obj, const char *name, const AVOption **o_out, c
|
||||
return buf;
|
||||
}
|
||||
|
||||
static int av_get_number(void *obj, const char *name, const AVOption **o_out, double *num, int *den, int64_t *intnum)
|
||||
static int get_number(void *obj, const char *name, const AVOption **o_out, double *num, int *den, int64_t *intnum)
|
||||
{
|
||||
const AVOption *o = av_opt_find(obj, name, NULL, 0, AV_OPT_SEARCH_CHILDREN);
|
||||
void *dst;
|
||||
@ -293,7 +293,7 @@ double av_get_double(void *obj, const char *name, const AVOption **o_out)
|
||||
double num=1;
|
||||
int den=1;
|
||||
|
||||
if (av_get_number(obj, name, o_out, &num, &den, &intnum) < 0)
|
||||
if (get_number(obj, name, o_out, &num, &den, &intnum) < 0)
|
||||
return NAN;
|
||||
return num*intnum/den;
|
||||
}
|
||||
@ -304,7 +304,7 @@ AVRational av_get_q(void *obj, const char *name, const AVOption **o_out)
|
||||
double num=1;
|
||||
int den=1;
|
||||
|
||||
if (av_get_number(obj, name, o_out, &num, &den, &intnum) < 0)
|
||||
if (get_number(obj, name, o_out, &num, &den, &intnum) < 0)
|
||||
return (AVRational){0, 0};
|
||||
if (num == 1.0 && (int)intnum == intnum)
|
||||
return (AVRational){intnum, den};
|
||||
@ -318,7 +318,7 @@ int64_t av_get_int(void *obj, const char *name, const AVOption **o_out)
|
||||
double num=1;
|
||||
int den=1;
|
||||
|
||||
if (av_get_number(obj, name, o_out, &num, &den, &intnum) < 0)
|
||||
if (get_number(obj, name, o_out, &num, &den, &intnum) < 0)
|
||||
return -1;
|
||||
return num*intnum/den;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user