aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2003-09-08 22:49:26 +0000
committerFabrice Bellard <fabrice@bellard.org>2003-09-08 22:49:26 +0000
commit98ce5991d766ad08c192632baedc896fd32fb7ad (patch)
treec10aacdb926bd497b16518deaef0e81ee9f591c7
parent6a58e1510d073e214db2fc2cbb9fe4c031a739e6 (diff)
downloadffmpeg-98ce5991d766ad08c192632baedc896fd32fb7ad.tar.gz
update sub_id in mpegaudio decoding (might need same method as MPEG2VIDEO too ?)
Originally committed as revision 2238 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/mpegaudiodec.c1
-rw-r--r--libavcodec/utils.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 43ec55daf2..51c8ef1305 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -2481,6 +2481,7 @@ static int decode_frame(AVCodecContext * avctx,
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;
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 33ff0f4153..c2705889ba 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -470,6 +470,12 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
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 {