changeset 1449:7fbe89a76b73 libavcodec

update sub_id in mpegaudio decoding (might need same method as MPEG2VIDEO too ?)
author bellard
date Mon, 08 Sep 2003 22:49:26 +0000
parents 317ba7ab73bd
children 357c19b0b27b
files mpegaudiodec.c utils.c
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mpegaudiodec.c	Mon Sep 08 22:04:29 2003 +0000
+++ b/mpegaudiodec.c	Mon Sep 08 22:49:26 2003 +0000
@@ -2481,6 +2481,7 @@
                     avctx->sample_rate = s->sample_rate;
                     avctx->channels = s->nb_channels;
                     avctx->bit_rate = s->bit_rate;
+                    avctx->sub_id = s->layer;
                     switch(s->layer) {
                     case 1:
                         avctx->frame_size = 384;
--- a/utils.c	Mon Sep 08 22:04:29 2003 +0000
+++ b/utils.c	Mon Sep 08 22:49:26 2003 +0000
@@ -470,6 +470,12 @@
 
     if (p) {
         codec_name = p->name;
+        if (!encode && enc->codec_id == CODEC_ID_MP3) {
+            if (enc->sub_id == 2)
+                codec_name = "mp2";
+            else if (enc->sub_id == 1)
+                codec_name = "mp1";
+        }
     } else if (enc->codec_name[0] != '\0') {
         codec_name = enc->codec_name;
     } else {