[FFmpeg-cvslog] Merge commit 'dd3aa85b68c017c419acb0c39ff6aa890ce89e87'

James Almer git at videolan.org
Mon Oct 30 22:30:57 EET 2017


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon Oct 30 17:18:20 2017 -0300| [9484b9f4ba66a96b9b565f33f1eeb6e9b9b79e96] | committer: James Almer

Merge commit 'dd3aa85b68c017c419acb0c39ff6aa890ce89e87'

* commit 'dd3aa85b68c017c419acb0c39ff6aa890ce89e87':
  aac_ac3_parser: Drop in-parser downmix functionality

Merged-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9484b9f4ba66a96b9b565f33f1eeb6e9b9b79e96
---

 libavcodec/aac_ac3_parser.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
index c9ba6bf062..4e834b4424 100644
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@ -86,20 +86,8 @@ get_next:
            the frame). */
         if (avctx->codec_id != AV_CODEC_ID_AAC) {
             avctx->sample_rate = s->sample_rate;
-
-            /* (E-)AC-3: allow downmixing to stereo or mono */
-            if (s->channels > 1 &&
-                avctx->request_channel_layout == AV_CH_LAYOUT_MONO) {
-                avctx->channels       = 1;
-                avctx->channel_layout = AV_CH_LAYOUT_MONO;
-            } else if (s->channels > 2 &&
-                       avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
-                avctx->channels       = 2;
-                avctx->channel_layout = AV_CH_LAYOUT_STEREO;
-            } else {
-                avctx->channels = s->channels;
-                avctx->channel_layout = s->channel_layout;
-            }
+            avctx->channels = s->channels;
+            avctx->channel_layout = s->channel_layout;
             s1->duration = s->samples;
             avctx->audio_service_type = s->service_type;
         }


======================================================================

diff --cc libavcodec/aac_ac3_parser.c
index c9ba6bf062,a754f4a957..4e834b4424
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@@ -78,34 -76,19 +78,22 @@@ get_next
      if(s->codec_id)
          avctx->codec_id = s->codec_id;
  
 -    /* Due to backwards compatible HE-AAC the sample rate, channel count,
 -       and total number of samples found in an AAC ADTS header are not
 -       reliable. Bit rate is still accurate because the total frame duration in
 -       seconds is still correct (as is the number of bits in the frame). */
 -    if (avctx->codec_id != AV_CODEC_ID_AAC) {
 -        avctx->sample_rate = s->sample_rate;
 -        avctx->channels = s->channels;
 -        avctx->channel_layout = s->channel_layout;
 -        s1->duration = s->samples;
 -        avctx->audio_service_type = s->service_type;
 -    }
 +    if (got_frame) {
 +        /* Due to backwards compatible HE-AAC the sample rate, channel count,
 +           and total number of samples found in an AAC ADTS header are not
 +           reliable. Bit rate is still accurate because the total frame
 +           duration in seconds is still correct (as is the number of bits in
 +           the frame). */
 +        if (avctx->codec_id != AV_CODEC_ID_AAC) {
 +            avctx->sample_rate = s->sample_rate;
- 
-             /* (E-)AC-3: allow downmixing to stereo or mono */
-             if (s->channels > 1 &&
-                 avctx->request_channel_layout == AV_CH_LAYOUT_MONO) {
-                 avctx->channels       = 1;
-                 avctx->channel_layout = AV_CH_LAYOUT_MONO;
-             } else if (s->channels > 2 &&
-                        avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
-                 avctx->channels       = 2;
-                 avctx->channel_layout = AV_CH_LAYOUT_STEREO;
-             } else {
-                 avctx->channels = s->channels;
-                 avctx->channel_layout = s->channel_layout;
-             }
++            avctx->channels = s->channels;
++            avctx->channel_layout = s->channel_layout;
 +            s1->duration = s->samples;
 +            avctx->audio_service_type = s->service_type;
 +        }
  
 -    avctx->bit_rate = s->bit_rate;
 +        avctx->bit_rate = s->bit_rate;
 +    }
  
      return i;
  }



More information about the ffmpeg-cvslog mailing list