[libav-devel] [PATCH 4/7] aac_ac3_parser: simplify an expression.

Tim Walker tdskywalker at gmail.com
Mon Nov 18 12:41:46 CET 2013


---
 libavcodec/aac_ac3_parser.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
index b17cd4d..00d95ad 100644
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@ -82,13 +82,9 @@ get_next:
     if (avctx->codec_id != AV_CODEC_ID_AAC) {
         avctx->sample_rate = s->sample_rate;
 
-        /* allow downmixing to stereo (or mono for AC-3) */
-        if(avctx->request_channels > 0 &&
-                avctx->request_channels < s->channels &&
-                (avctx->request_channels <= 2 ||
-                (avctx->request_channels == 1 &&
-                (avctx->codec_id == AV_CODEC_ID_AC3 ||
-                 avctx->codec_id == AV_CODEC_ID_EAC3)))) {
+        /* (E-)AC-3: allow downmixing to stereo or mono */
+        if (avctx->request_channels > 0 && avctx->request_channels <= 2 &&
+            avctx->request_channels < s->channels) {
             avctx->channels = avctx->request_channels;
         } else {
             avctx->channels = s->channels;
-- 
1.8.3.4 (Apple Git-47)



More information about the libav-devel mailing list