rmdec: use the deinterleaving mode and not the codec when creating audio packets.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 17 Sep 2011 21:17:45 +0000 (21:17 +0000)
committerAnton Khirnov <anton@khirnov.net>
Mon, 19 Sep 2011 10:37:31 +0000 (12:37 +0200)
It prevents crashes due to non initialized fields.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavformat/rmdec.c

index 02ff7e9..4b89181 100644 (file)
@@ -813,7 +813,8 @@ ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
 
     assert (rm->audio_pkt_cnt > 0);
 
-    if (st->codec->codec_id == CODEC_ID_AAC)
+    if (ast->deint_id == DEINT_ID_VBRF ||
+        ast->deint_id == DEINT_ID_VBRS)
         av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
     else {
         av_new_packet(pkt, st->codec->block_align);