Merge commit '8083332c2de9ee189f96844ff4c2d9be1844116f'
* commit '8083332c2de9ee189f96844ff4c2d9be1844116f': asyncts: use clipped delta value when setting resample compensation asyncts: fix flushing of final samples at EOF vp6: properly fail on unsupported feature Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
593f5c0f3c
@ -63,8 +63,8 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size)
|
|||||||
return 0;
|
return 0;
|
||||||
s->filter_header = buf[1] & 0x06;
|
s->filter_header = buf[1] & 0x06;
|
||||||
if (buf[1] & 1) {
|
if (buf[1] & 1) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "interlacing not supported\n");
|
av_log_missing_feature(s->avctx, "Interlacing", 0);
|
||||||
return 0;
|
return AVERROR_PATCHWELCOME;
|
||||||
}
|
}
|
||||||
if (separated_coeff || !s->filter_header) {
|
if (separated_coeff || !s->filter_header) {
|
||||||
coeff_offset = AV_RB16(buf+2) - 2;
|
coeff_offset = AV_RB16(buf+2) - 2;
|
||||||
|
@ -110,6 +110,12 @@ static int config_props(AVFilterLink *link)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* get amount of data currently buffered, in samples */
|
||||||
|
static int64_t get_delay(ASyncContext *s)
|
||||||
|
{
|
||||||
|
return avresample_available(s->avr) + avresample_get_delay(s->avr);
|
||||||
|
}
|
||||||
|
|
||||||
static int request_frame(AVFilterLink *link)
|
static int request_frame(AVFilterLink *link)
|
||||||
{
|
{
|
||||||
AVFilterContext *ctx = link->src;
|
AVFilterContext *ctx = link->src;
|
||||||
@ -122,7 +128,7 @@ static int request_frame(AVFilterLink *link)
|
|||||||
ret = ff_request_frame(ctx->inputs[0]);
|
ret = ff_request_frame(ctx->inputs[0]);
|
||||||
|
|
||||||
/* flush the fifo */
|
/* flush the fifo */
|
||||||
if (ret == AVERROR_EOF && (nb_samples = avresample_get_delay(s->avr))) {
|
if (ret == AVERROR_EOF && (nb_samples = get_delay(s))) {
|
||||||
AVFilterBufferRef *buf = ff_get_audio_buffer(link, AV_PERM_WRITE,
|
AVFilterBufferRef *buf = ff_get_audio_buffer(link, AV_PERM_WRITE,
|
||||||
nb_samples);
|
nb_samples);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
@ -149,12 +155,6 @@ static int write_to_fifo(ASyncContext *s, AVFilterBufferRef *buf)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get amount of data currently buffered, in samples */
|
|
||||||
static int64_t get_delay(ASyncContext *s)
|
|
||||||
{
|
|
||||||
return avresample_available(s->avr) + avresample_get_delay(s->avr);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
|
static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
|
||||||
{
|
{
|
||||||
AVFilterContext *ctx = inlink->dst;
|
AVFilterContext *ctx = inlink->dst;
|
||||||
@ -191,7 +191,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
|
|||||||
if (s->resample) {
|
if (s->resample) {
|
||||||
int comp = av_clip(delta, -s->max_comp, s->max_comp);
|
int comp = av_clip(delta, -s->max_comp, s->max_comp);
|
||||||
av_log(ctx, AV_LOG_VERBOSE, "Compensating %d samples per second.\n", comp);
|
av_log(ctx, AV_LOG_VERBOSE, "Compensating %d samples per second.\n", comp);
|
||||||
avresample_set_compensation(s->avr, delta, inlink->sample_rate);
|
avresample_set_compensation(s->avr, comp, inlink->sample_rate);
|
||||||
}
|
}
|
||||||
delta = 0;
|
delta = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user