Commit 58677d73 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  avconv: fix some bugs introduced in 630902a1
  libmp3lame: fix typo
  AVOptions: drop av_ prefix from static av_get_number().
  libx264: use X264_THREADS_AUTO constant instead of 0.
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents acc3c380 62486948
...@@ -1891,13 +1891,13 @@ static int init_input_stream(int ist_index, OutputStream *output_streams, int nb ...@@ -1891,13 +1891,13 @@ static int init_input_stream(int ist_index, OutputStream *output_streams, int nb
if (ist->decoding_needed) { if (ist->decoding_needed) {
AVCodec *codec = ist->dec; AVCodec *codec = ist->dec;
if (!codec) { 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); ist->st->codec->codec_id, ist->file_index, ist->st->index);
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
if (avcodec_open2(ist->st->codec, codec, &ist->opts) < 0) { 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); ist->file_index, ist->st->index);
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
...@@ -2203,7 +2203,7 @@ static int transcode_init(OutputFile *output_files, ...@@ -2203,7 +2203,7 @@ static int transcode_init(OutputFile *output_files,
/* init input streams */ /* init input streams */
for (i = 0; i < nb_input_streams; i++) 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; goto dump_format;
/* open files and write file headers */ /* open files and write file headers */
......
...@@ -72,7 +72,7 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx) ...@@ -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_VBR_quality(s->gfp, avctx->global_quality/(float)FF_QP2LAMBDA);
} }
lame_set_bWriteVbrTag(s->gfp,0); 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; s->reservoir = avctx->flags2 & CODEC_FLAG2_BIT_RESERVOIR;
#endif #endif
lame_set_disable_reservoir(s->gfp, !s->reservoir); lame_set_disable_reservoir(s->gfp, !s->reservoir);
......
...@@ -548,7 +548,7 @@ static const AVClass class = { ...@@ -548,7 +548,7 @@ static const AVClass class = {
static const AVCodecDefault x264_defaults[] = { static const AVCodecDefault x264_defaults[] = {
{ "b", "0" }, { "b", "0" },
{ "threads", "0" }, { "threads", AV_STRINGIFY(X264_THREADS_AUTO) },
{ NULL }, { NULL },
}; };
......
...@@ -260,7 +260,7 @@ const char *av_get_string(void *obj, const char *name, const AVOption **o_out, c ...@@ -260,7 +260,7 @@ const char *av_get_string(void *obj, const char *name, const AVOption **o_out, c
return buf; 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); const AVOption *o = av_opt_find(obj, name, NULL, 0, AV_OPT_SEARCH_CHILDREN);
void *dst; void *dst;
...@@ -293,7 +293,7 @@ double av_get_double(void *obj, const char *name, const AVOption **o_out) ...@@ -293,7 +293,7 @@ double av_get_double(void *obj, const char *name, const AVOption **o_out)
double num=1; double num=1;
int den=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 NAN;
return num*intnum/den; return num*intnum/den;
} }
...@@ -304,7 +304,7 @@ AVRational av_get_q(void *obj, const char *name, const AVOption **o_out) ...@@ -304,7 +304,7 @@ AVRational av_get_q(void *obj, const char *name, const AVOption **o_out)
double num=1; double num=1;
int den=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}; return (AVRational){0, 0};
if (num == 1.0 && (int)intnum == intnum) if (num == 1.0 && (int)intnum == intnum)
return (AVRational){intnum, den}; return (AVRational){intnum, den};
...@@ -318,7 +318,7 @@ int64_t av_get_int(void *obj, const char *name, const AVOption **o_out) ...@@ -318,7 +318,7 @@ int64_t av_get_int(void *obj, const char *name, const AVOption **o_out)
double num=1; double num=1;
int den=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 -1;
return num*intnum/den; return num*intnum/den;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment