]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/aac_ac3_parser.c
cbs: Add an explicit type for coded bitstream unit types
[ffmpeg] / libavcodec / aac_ac3_parser.c
index f65a4aa22b49f83885eaa9e01d2d16816f6b9331..a754f4a9579aba35fdf8c07ca34724533abb25a1 100644 (file)
@@ -20,6 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/channel_layout.h"
+#include "libavutil/common.h"
 #include "parser.h"
 #include "aac_ac3_parser.h"
 
@@ -78,22 +80,12 @@ get_next:
        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 != CODEC_ID_AAC) {
+    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 == CODEC_ID_AC3 ||
-                 avctx->codec_id == CODEC_ID_EAC3)))) {
-            avctx->channels = avctx->request_channels;
-        } else {
-            avctx->channels = s->channels;
-            avctx->channel_layout = s->channel_layout;
-        }
-        avctx->frame_size = s->samples;
+        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;