Commit 65e63072 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  rtmp: Return a proper error code instead of -1
  rtmp: Check malloc calls
  rtmp: Check ff_rtmp_packet_create calls
  lavfi: add audio mix filter
  flvdec: Make sure sample_rate is set to the updated value
  tqi: Pass errors from the MB decoder

Conflicts:
	Changelog
	doc/filters.texi
	libavcodec/eatqi.c
	libavfilter/Makefile
	libavfilter/allfilters.c
	libavfilter/version.h
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents ba4aa656 a4d3f358
......@@ -38,6 +38,7 @@ version 0.11:
- audio split filter
- vorbis parser
- png parser
- audio mix filter
version 0.10:
......
......@@ -216,6 +216,44 @@ amovie=input.mkv:si=5 [a5];
[x3][a5] amerge" -c:a pcm_s16le output.mkv
@end example
@section amix
Mixes multiple audio inputs into a single output.
For example
@example
ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
@end example
will mix 3 input audio streams to a single output with the same duration as the
first input and a dropout transition time of 3 seconds.
The filter accepts the following named parameters:
@table @option
@item inputs
Number of inputs. If unspecified, it defaults to 2.
@item duration
How to determine the end-of-stream.
@table @option
@item longest
Duration of longest input. (default)
@item shortest
Duration of shortest input.
@item first
Duration of first input.
@end table
@item dropout_transition
Transition time, in seconds, for volume renormalization when an input
stream ends. The default value is 2 seconds.
@end table
@section anull
Pass the audio source unchanged to the output.
......
......@@ -62,7 +62,7 @@ static int tqi_decode_mb(MpegEncContext *s, DCTELEM (*block)[64])
int n;
s->dsp.clear_blocks(block[0]);
for (n=0; n<6; n++)
if(ff_mpeg1_decode_block_intra(s, block[n], n)<0)
if (ff_mpeg1_decode_block_intra(s, block[n], n) < 0)
return -1;
return 0;
......@@ -138,7 +138,7 @@ static int tqi_decode_frame(AVCodecContext *avctx,
for (s->mb_y=0; s->mb_y<(avctx->height+15)/16; s->mb_y++)
for (s->mb_x=0; s->mb_x<(avctx->width+15)/16; s->mb_x++)
{
if(tqi_decode_mb(s, t->block) < 0)
if (tqi_decode_mb(s, t->block) < 0)
goto end;
tqi_idct_put(t, t->block);
}
......
......@@ -47,6 +47,7 @@ OBJS-$(CONFIG_SWSCALE) += lswsutils.o
OBJS-$(CONFIG_ACONVERT_FILTER) += af_aconvert.o
OBJS-$(CONFIG_AFORMAT_FILTER) += af_aformat.o
OBJS-$(CONFIG_AMERGE_FILTER) += af_amerge.o
OBJS-$(CONFIG_AMIX_FILTER) += af_amix.o
OBJS-$(CONFIG_ANULL_FILTER) += af_anull.o
OBJS-$(CONFIG_ARESAMPLE_FILTER) += af_aresample.o
OBJS-$(CONFIG_ASHOWINFO_FILTER) += af_ashowinfo.o
......
This diff is collapsed.
......@@ -37,6 +37,7 @@ void avfilter_register_all(void)
REGISTER_FILTER (ACONVERT, aconvert, af);
REGISTER_FILTER (AFORMAT, aformat, af);
REGISTER_FILTER (AMERGE, amerge, af);
REGISTER_FILTER (AMIX, amix, af);
REGISTER_FILTER (ANULL, anull, af);
REGISTER_FILTER (ARESAMPLE, aresample, af);
REGISTER_FILTER (ASHOWINFO, ashowinfo, af);
......
......@@ -29,7 +29,7 @@
#include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 2
#define LIBAVFILTER_VERSION_MINOR 76
#define LIBAVFILTER_VERSION_MINOR 77
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
......
......@@ -591,8 +591,8 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
}
if(!st->codec->codec_id){
flv_set_audio_codec(s, st, st->codec, flags & FLV_AUDIO_CODECID_MASK);
flv->last_sample_rate = st->codec->sample_rate;
flv->last_channels = st->codec->channels;
flv->last_sample_rate = sample_rate = st->codec->sample_rate;
flv->last_channels = channels = st->codec->channels;
} else {
AVCodecContext ctx;
ctx.sample_rate = sample_rate;
......
......@@ -79,6 +79,7 @@ int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p,
uint32_t extra = 0;
enum RTMPPacketType type;
int size = 0;
int ret;
if (ffurl_read(h, &hdr, 1) != 1)
return AVERROR(EIO);
......@@ -129,8 +130,9 @@ int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p,
if (hdr != RTMP_PS_TWELVEBYTES)
timestamp += prev_pkt[channel_id].timestamp;
if (ff_rtmp_packet_create(p, channel_id, type, timestamp, data_size))
return -1;
if ((ret = ff_rtmp_packet_create(p, channel_id, type, timestamp,
data_size)) < 0)
return ret;
p->extra = extra;
// save history
prev_pkt[channel_id].channel_id = channel_id;
......
This diff is collapsed.
......@@ -39,8 +39,8 @@ fate-nellymoser-aref-encode: $(AREF)
fate-nellymoser-aref-encode: CMD = enc_dec_pcm flv wav s16le $(REF) -c:a nellymoser
fate-nellymoser-aref-encode: CMP = stddev
fate-nellymoser-aref-encode: REF = ./tests/data/acodec-16000-1.ref.wav
fate-nellymoser-aref-encode: CMP_SHIFT = -1172
fate-nellymoser-aref-encode: CMP_TARGET = 9617
fate-nellymoser-aref-encode: CMP_SHIFT = -244
fate-nellymoser-aref-encode: CMP_TARGET = 9612
fate-nellymoser-aref-encode: SIZE_TOLERANCE = 268
FATE_SAMPLES_AUDIO += fate-sierra-vmd-audio
......
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