The planar/packed switch and the packing_formats list is no longer required, since the planar/packed information is now stored in the sample format enum. This is technically a major API break, possibly it should be not too painful as we marked the audio filtering API as unstable.
Showing the changes to libavfilter/src_buffer.c (1 of 28 files). Show all
Unified · Split
| @@ -55,7 +55,6 @@ typedef struct { · 54 unmodified lines | ||
| 55 | 55 | int sample_rate; |
| 56 | 56 | unsigned int sample_format; |
| 57 | 57 | int64_t channel_layout; |
| 58 | − int packing_format; | |
| 59 | 58 | |
| 60 | 59 | // Normalization filters |
| 61 | 60 | AVFilterContext *aconvert; |
| @@ -91,7 +90,6 @@ static int reconfigure_filter(BufferSourceContext *abuffer, AVFilterContext *fil · 29 unmodified lines | ||
| 91 | 90 | |
| 92 | 91 | inlink->format = abuffer->sample_format; |
| 93 | 92 | inlink->channel_layout = abuffer->channel_layout; |
| 94 | − inlink->planar = abuffer->packing_format; | |
| 95 | 93 | inlink->sample_rate = abuffer->sample_rate; |
| 96 | 94 | |
| 97 | 95 | filt_ctx->filter->uninit(filt_ctx); |
| @@ -239,14 +237,12 @@ static int check_format_change_audio(AVFilterContext *ctx, · 141 unmodified lines | ||
| 239 | 237 | |
| 240 | 238 | link = ctx->outputs[0]; |
| 241 | 239 | if (samplesref->format != link->format || |
| 242 | − samplesref->audio->channel_layout != link->channel_layout || | |
| 243 | − samplesref->audio->planar != link->planar) { | |
| 240 | + samplesref->audio->channel_layout != link->channel_layout) { | |
| 244 | 241 | |
| 245 | 242 | if (!logged) log_input_change(ctx, link, samplesref); |
| 246 | 243 | |
| 247 | 244 | abuffer->sample_format = samplesref->format; |
| 248 | 245 | abuffer->channel_layout = samplesref->audio->channel_layout; |
| 249 | − abuffer->packing_format = samplesref->audio->planar; | |
| 250 | 246 | |
| 251 | 247 | if (!abuffer->aconvert) { |
| 252 | 248 | ret = insert_filter(abuffer, link, &abuffer->aconvert, "aconvert"); |
| @@ -254,9 +250,7 @@ static int check_format_change_audio(AVFilterContext *ctx, · 1 unmodified line | ||
| 254 | 250 | } else { |
| 255 | 251 | link = abuffer->aconvert->outputs[0]; |
| 256 | 252 | if (samplesref->format == link->format && |
| 257 | − samplesref->audio->channel_layout == link->channel_layout && | |
| 258 | − samplesref->audio->planar == link->planar | |
| 259 | − ) | |
| 253 | + samplesref->audio->channel_layout == link->channel_layout) | |
| 260 | 254 | remove_filter(&abuffer->aconvert); |
| 261 | 255 | else |
| 262 | 256 | if ((ret = reconfigure_filter(abuffer, abuffer->aconvert)) < 0) |
| @@ -456,7 +450,6 @@ static av_cold int init_audio(AVFilterContext *ctx, const char *args0, void *opa · 193 unmodified lines | ||
| 456 | 450 | ADD_FORMAT(sample_rate); |
| 457 | 451 | ADD_FORMAT(sample_format); |
| 458 | 452 | ADD_FORMAT(channel_layout); |
| 459 | − ADD_FORMAT(packing_format); | |
| 460 | 453 | |
| 461 | 454 | abuffer->fifo = av_fifo_alloc(FIFO_SIZE*sizeof(AVFilterBufferRef*)); |
| 462 | 455 | if (!abuffer->fifo) { |
| @@ -475,7 +468,7 @@ static av_cold int init_audio(AVFilterContext *ctx, const char *args0, void *opa · 12 unmodified lines | ||
| 475 | 468 | |
| 476 | 469 | arg_fail: |
| 477 | 470 | av_log(ctx, AV_LOG_ERROR, "Invalid arguments, must be of the form " |
| 478 | − "sample_rate:sample_fmt:channel_layout:packing\n"); | |
| 471 | + "sample_rate:sample_fmt:channel_layout\n"); | |
| 479 | 472 | av_freep(&args); |
| 480 | 473 | return AVERROR(EINVAL); |
| 481 | 474 | } |
| @@ -517,10 +510,6 @@ static int query_formats_audio(AVFilterContext *ctx) · 35 unmodified lines | ||
| 517 | 510 | ff_add_channel_layout(&layouts, abuffer->channel_layout); |
| 518 | 511 | ff_set_common_channel_layouts(ctx, layouts); |
| 519 | 512 | |
| 520 | − formats = NULL; | |
| 521 | − avfilter_add_format(&formats, abuffer->packing_format); | |
| 522 | − avfilter_set_common_packing_formats(ctx, formats); | |
| 523 | − | |
| 524 | 513 | return 0; |
| 525 | 514 | } |
| 526 | 515 | |