diff amr.c @ 1368:f9d59429f182 libavformat

factorze another 2 lines
author michael
date Tue, 10 Oct 2006 23:53:14 +0000
parents 8e0ee2faf4d5
children bf2c4889a9bf
line wrap: on
line diff
--- a/amr.c	Tue Oct 10 23:49:45 2006 +0000
+++ b/amr.c	Tue Oct 10 23:53:14 2006 +0000
@@ -104,10 +104,8 @@
             return AVERROR_NOMEM;
         }
 
-        st->codec->codec_type = CODEC_TYPE_AUDIO;
         st->codec->codec_tag = MKTAG('s', 'a', 'w', 'b');
         st->codec->codec_id = CODEC_ID_AMR_WB;
-        st->codec->channels = 1;
         st->codec->sample_rate = 16000;
     }
     else
@@ -118,12 +116,12 @@
             return AVERROR_NOMEM;
         }
 
-        st->codec->codec_type = CODEC_TYPE_AUDIO;
         st->codec->codec_tag = MKTAG('s', 'a', 'm', 'r');
         st->codec->codec_id = CODEC_ID_AMR_NB;
-        st->codec->channels = 1;
         st->codec->sample_rate = 8000;
     }
+    st->codec->channels = 1;
+    st->codec->codec_type = CODEC_TYPE_AUDIO;
     av_set_pts_info(st, 64, 1, st->codec->sample_rate);
 
     return 0;