tools/uncoded_frame: fix audio codec generation
authorLukasz Marek <lukasz.m.luki@gmail.com>
Mon, 24 Mar 2014 16:49:04 +0000 (17:49 +0100)
committerLukasz Marek <lukasz.m.luki@gmail.com>
Sat, 29 Mar 2014 08:25:14 +0000 (09:25 +0100)
Codec id is guessed from uninitialized sample format.

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
tools/uncoded_frame.c

index eafbbfd..53e71ea 100644 (file)
@@ -177,12 +177,12 @@ int main(int argc, char **argv)
             st->stream->codec->pix_fmt             = st->link->format;
             break;
         case AVMEDIA_TYPE_AUDIO:
-            st->stream->codec->codec_id =
-                av_get_pcm_codec(st->stream->codec->sample_fmt, -1);
             st->stream->codec->channel_layout = st->link->channel_layout;
             st->stream->codec->channels = avfilter_link_get_channels(st->link);
             st->stream->codec->sample_rate = st->link->sample_rate;
             st->stream->codec->sample_fmt = st->link->format;
+            st->stream->codec->codec_id =
+                av_get_pcm_codec(st->stream->codec->sample_fmt, -1);
             break;
         default:
             av_assert0(!"reached");