Merge commit '05015d03da1d745bb92915b5cea92dec16af719f' into release/1.1
* commit '05015d03da1d745bb92915b5cea92dec16af719f': matroska: fix a corner case in ebml-lace parsing avfiltergraph: check for sws opts being non-NULL before using them. configure: Enable hwaccels without external dependencies by default. oma: Validate sample rates Conflicts: libavfilter/avfiltergraph.c libavfilter/graphparser.c libavformat/oma.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
3
configure
vendored
3
configure
vendored
@@ -2100,6 +2100,9 @@ enable safe_bitstream_reader
|
|||||||
enable static
|
enable static
|
||||||
enable swscale_alpha
|
enable swscale_alpha
|
||||||
|
|
||||||
|
# By default, enable only those hwaccels that have no external dependencies.
|
||||||
|
enable dxva2 vdpau
|
||||||
|
|
||||||
# build settings
|
# build settings
|
||||||
SHFLAGS='-shared -Wl,-soname,$$(@F)'
|
SHFLAGS='-shared -Wl,-soname,$$(@F)'
|
||||||
FFSERVERLDFLAGS=-Wl,-E
|
FFSERVERLDFLAGS=-Wl,-E
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
|
#include "libavutil/avstring.h"
|
||||||
#include "libavutil/channel_layout.h"
|
#include "libavutil/channel_layout.h"
|
||||||
#include "libavutil/opt.h"
|
#include "libavutil/opt.h"
|
||||||
#include "libavutil/pixdesc.h"
|
#include "libavutil/pixdesc.h"
|
||||||
@@ -373,11 +374,11 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
|
|||||||
|
|
||||||
snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d",
|
snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d",
|
||||||
scaler_count++);
|
scaler_count++);
|
||||||
if (graph->scale_sws_opts)
|
av_strlcpy(scale_args, "0:0", sizeof(scale_args));
|
||||||
snprintf(scale_args, sizeof(scale_args), "0:0:%s", graph->scale_sws_opts);
|
if (graph->scale_sws_opts) {
|
||||||
else
|
av_strlcat(scale_args, ":", sizeof(scale_args));
|
||||||
snprintf(scale_args, sizeof(scale_args), "0:0");
|
av_strlcat(scale_args, graph->scale_sws_opts, sizeof(scale_args));
|
||||||
|
}
|
||||||
if ((ret = avfilter_graph_create_filter(&convert, filter,
|
if ((ret = avfilter_graph_create_filter(&convert, filter,
|
||||||
inst_name, scale_args, NULL,
|
inst_name, scale_args, NULL,
|
||||||
graph)) < 0)
|
graph)) < 0)
|
||||||
|
@@ -123,8 +123,8 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags")
|
if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags") &&
|
||||||
&& ctx->scale_sws_opts) {
|
ctx->scale_sws_opts) {
|
||||||
snprintf(tmp_args, sizeof(tmp_args), "%s:%s",
|
snprintf(tmp_args, sizeof(tmp_args), "%s:%s",
|
||||||
args, ctx->scale_sws_opts);
|
args, ctx->scale_sws_opts);
|
||||||
args = tmp_args;
|
args = tmp_args;
|
||||||
|
@@ -1958,7 +1958,7 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
|
|||||||
|
|
||||||
case 0x3: /* EBML lacing */ {
|
case 0x3: /* EBML lacing */ {
|
||||||
uint64_t num;
|
uint64_t num;
|
||||||
uint32_t total;
|
uint64_t total;
|
||||||
n = matroska_ebmlnum_uint(matroska, data, size, &num);
|
n = matroska_ebmlnum_uint(matroska, data, size, &num);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
av_log(matroska->ctx, AV_LOG_INFO,
|
av_log(matroska->ctx, AV_LOG_INFO,
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
#include "oma.h"
|
#include "oma.h"
|
||||||
#include "libavcodec/avcodec.h"
|
#include "libavcodec/avcodec.h"
|
||||||
|
|
||||||
const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0, 0, 0};
|
const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0 };
|
||||||
|
|
||||||
const AVCodecTag ff_oma_codec_tags[] = {
|
const AVCodecTag ff_oma_codec_tags[] = {
|
||||||
{ AV_CODEC_ID_ATRAC3, OMA_CODECID_ATRAC3 },
|
{ AV_CODEC_ID_ATRAC3, OMA_CODECID_ATRAC3 },
|
||||||
|
@@ -309,7 +309,11 @@ static int oma_read_header(AVFormatContext *s)
|
|||||||
|
|
||||||
switch (buf[32]) {
|
switch (buf[32]) {
|
||||||
case OMA_CODECID_ATRAC3:
|
case OMA_CODECID_ATRAC3:
|
||||||
samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7]*100;
|
samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7] * 100;
|
||||||
|
if (!samplerate) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "Unsupported sample rate\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
if (samplerate != 44100)
|
if (samplerate != 44100)
|
||||||
av_log_ask_for_sample(s, "Unsupported sample rate: %d\n",
|
av_log_ask_for_sample(s, "Unsupported sample rate: %d\n",
|
||||||
samplerate);
|
samplerate);
|
||||||
@@ -340,9 +344,14 @@ static int oma_read_header(AVFormatContext *s)
|
|||||||
case OMA_CODECID_ATRAC3P:
|
case OMA_CODECID_ATRAC3P:
|
||||||
st->codec->channels = (codec_params >> 10) & 7;
|
st->codec->channels = (codec_params >> 10) & 7;
|
||||||
framesize = ((codec_params & 0x3FF) * 8) + 8;
|
framesize = ((codec_params & 0x3FF) * 8) + 8;
|
||||||
st->codec->sample_rate = ff_oma_srate_tab[(codec_params >> 13) & 7]*100;
|
samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7] * 100;
|
||||||
st->codec->bit_rate = st->codec->sample_rate * framesize * 8 / 1024;
|
if (!samplerate) {
|
||||||
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
av_log(s, AV_LOG_ERROR, "Unsupported sample rate\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
st->codec->sample_rate = samplerate;
|
||||||
|
st->codec->bit_rate = samplerate * framesize * 8 / 1024;
|
||||||
|
avpriv_set_pts_info(st, 64, 1, samplerate);
|
||||||
av_log(s, AV_LOG_ERROR, "Unsupported codec ATRAC3+!\n");
|
av_log(s, AV_LOG_ERROR, "Unsupported codec ATRAC3+!\n");
|
||||||
break;
|
break;
|
||||||
case OMA_CODECID_MP3:
|
case OMA_CODECID_MP3:
|
||||||
|
Reference in New Issue
Block a user