From patchwork Mon Feb 10 23:24:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 17756 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 3B55044ABCD for ; Tue, 11 Feb 2020 01:25:19 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1751B68AEB7; Tue, 11 Feb 2020 01:25:19 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5574368A661 for ; Tue, 11 Feb 2020 01:25:12 +0200 (EET) Received: by mail-il1-f180.google.com with SMTP id s18so1861023iln.0 for ; Mon, 10 Feb 2020 15:25:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Ggyjb98t2wkaOvbYWysIijdWJoyDjkTrcMkfI6fg6mU=; b=Ht5Q1o9zW6e2Fd9vXwWjy8XHy0OuYRiJm+H5T7PzfOWWl1V6pw2VMO74QcHjIQ23jy mk+y3upySvEGYDFHfB6n3RF7AAJwdzf6s/FjjvxVjPPxk9jBcxrsABDpGl/MU8FSkXEt ytfThoYoun/pzLW1Ui11L/rF+SXWP+H45S/k28XavUPXlZxsV8LsPVdhYdsptFTUb5iE WPdoXpgQePga+kngT90qoyXSqJ7v7QT0yHdDCakNehNio4uaWi4NqpKVjdaqfCt3ANx9 Rivfo0AI8jWB8lD2pe+YdXlDX5NFdD1A7rtWE89qyKAIXgAuVdT/497DBY8Lqox7RWZa 7fsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Ggyjb98t2wkaOvbYWysIijdWJoyDjkTrcMkfI6fg6mU=; b=WdLXh6xGZK1pYh1C4EATkSWrnnxWMIwEoJ2kvknF1J54oEmkpumVp3N4yJzO0QpsUW L7fMdN/F1xSsJFexNTyWA/UyMOQi/gQJ/5/aajTNoEhiV6aNGRkDmacZsKQqNBek+wku jjK4912CwUOFke5XgULkiEPmtCYjzd6kPnPxGqyL5pSx/VvaBT8GHPeMsxVDt9tqrTLl WmFyjbYKfk+Q4/tVh2ccQP6rFbEJ3ehkD7YLQLBGszmLFUMNJh9Y7DQfOVe5z0VRvKiA OWcdCbqFD5tTYMWmdM+g1j0swd04Aqjp/G+tJCCkmArPUkN2Qf+AAfVRz6+zqFHkV+t1 KXMg== X-Gm-Message-State: APjAAAX3u80cCgtovt4dA1OMsEQAmM1Vkw/3LaICul8K5YIotBSzjp2A CKyXTf0XGgl3Fnch4Vedt2BQTYSnJ8gJ23F7WHrMNoAu X-Google-Smtp-Source: APXvYqwmV0NggnH+7bQJeTYriqYQ+NrzO2IcdOa0nsJtpSpMS0STWxsIzoauIO3LnpqrczZ6sY8JNhUE9Z2Mk2b3OAo= X-Received: by 2002:a92:58d7:: with SMTP id z84mr3678182ilf.179.1581377110704; Mon, 10 Feb 2020 15:25:10 -0800 (PST) MIME-Version: 1.0 From: Carl Eugen Hoyos Date: Tue, 11 Feb 2020 00:24:59 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH]lavc: Use supported_samplerates for Dolby Digital encoders X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi! Attached patch probably fixes ticket #8518 and definitely simplifies *ac3* encoding usage. Please comment, Carl Eugen From 6ddde8224f48e9a0648018934ff12961c5d30892 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Tue, 11 Feb 2020 00:20:52 +0100 Subject: [PATCH] lavc: Use supported_samplerates for Dolby Digital encoders. Fixes ticket #8518. --- libavcodec/ac3enc_fixed.c | 1 + libavcodec/ac3enc_float.c | 1 + libavcodec/ac3tab.c | 2 +- libavcodec/ac3tab.h | 2 +- libavcodec/eac3enc.c | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/ac3enc_fixed.c b/libavcodec/ac3enc_fixed.c index b23fc64776..e57d035294 100644 --- a/libavcodec/ac3enc_fixed.c +++ b/libavcodec/ac3enc_fixed.c @@ -155,6 +155,7 @@ AVCodec ff_ac3_fixed_encoder = { .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .priv_class = &ac3enc_class, + .supported_samplerates = ff_ac3_sample_rate_tab, .channel_layouts = ff_ac3_channel_layouts, .defaults = ac3_defaults, }; diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c index d6e658b2b4..1f3111af0e 100644 --- a/libavcodec/ac3enc_float.c +++ b/libavcodec/ac3enc_float.c @@ -150,6 +150,7 @@ AVCodec ff_ac3_encoder = { .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .priv_class = &ac3enc_class, + .supported_samplerates = ff_ac3_sample_rate_tab, .channel_layouts = ff_ac3_channel_layouts, .defaults = ac3_defaults, }; diff --git a/libavcodec/ac3tab.c b/libavcodec/ac3tab.c index bd88f32d92..96ef8ebaeb 100644 --- a/libavcodec/ac3tab.c +++ b/libavcodec/ac3tab.c @@ -126,7 +126,7 @@ const uint8_t ff_ac3_dec_channel_map[8][2][6] = { }; /* possible frequencies */ -const uint16_t ff_ac3_sample_rate_tab[3] = { 48000, 44100, 32000 }; +const int ff_ac3_sample_rate_tab[3] = { 48000, 44100, 32000 }; /* possible bitrates */ const uint16_t ff_ac3_bitrate_tab[19] = { diff --git a/libavcodec/ac3tab.h b/libavcodec/ac3tab.h index aa71acbce1..f0f6e6ccc4 100644 --- a/libavcodec/ac3tab.h +++ b/libavcodec/ac3tab.h @@ -33,7 +33,7 @@ extern const uint8_t ff_ac3_channels_tab[8]; extern av_export_avcodec const uint16_t avpriv_ac3_channel_layout_tab[8]; extern const uint8_t ff_ac3_enc_channel_map[8][2][6]; extern const uint8_t ff_ac3_dec_channel_map[8][2][6]; -extern const uint16_t ff_ac3_sample_rate_tab[3]; +extern const int ff_ac3_sample_rate_tab[3]; extern const uint16_t ff_ac3_bitrate_tab[19]; extern const uint8_t ff_ac3_rematrix_band_tab[5]; extern const uint8_t ff_eac3_default_cpl_band_struct[18]; diff --git a/libavcodec/eac3enc.c b/libavcodec/eac3enc.c index e1d61f68bf..6a90571e56 100644 --- a/libavcodec/eac3enc.c +++ b/libavcodec/eac3enc.c @@ -263,6 +263,7 @@ AVCodec ff_eac3_encoder = { .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .priv_class = &eac3enc_class, + .supported_samplerates = ff_ac3_sample_rate_tab, .channel_layouts = ff_ac3_channel_layouts, .defaults = ac3_defaults, }; -- 2.24.1