Revision c5efef7b libavformat/rmdec.c

View differences:

libavformat/rmdec.c
627 627

  
628 628
            if (++(ast->sub_packet_cnt) < h)
629 629
                return -1;
630
            else {
631 630
                ast->sub_packet_cnt = 0;
632 631
                rm->audio_stream_num = st->index;
633
                rm->audio_pkt_cnt = h * w / st->codec->block_align - 1;
634
                // Release first audio packet
635
                av_new_packet(pkt, st->codec->block_align);
636
                memcpy(pkt->data, ast->pkt.data, st->codec->block_align); //FIXME avoid this
637
                *timestamp = ast->audiotimestamp;
638
                *flags = 2; // Mark first packet as keyframe
639
            }
632
                rm->audio_pkt_cnt = h * w / st->codec->block_align;
640 633
        } else if (st->codec->codec_id == CODEC_ID_AAC) {
641 634
            int x;
642 635
            rm->audio_stream_num = st->index;
......
644 637
            if (ast->sub_packet_cnt) {
645 638
                for (x = 0; x < ast->sub_packet_cnt; x++)
646 639
                    ast->sub_packet_lengths[x] = get_be16(pb);
647
                // Release first audio packet
648
                rm->audio_pkt_cnt = ast->sub_packet_cnt - 1;
649
                av_get_packet(pb, pkt, ast->sub_packet_lengths[0]);
650
                *flags = 2; // Mark first packet as keyframe
651
            }
640
                rm->audio_pkt_cnt = ast->sub_packet_cnt;
641
                ast->audiotimestamp = *timestamp;
642
            } else
643
                return -1;
652 644
        } else {
653 645
            av_get_packet(pb, pkt, len);
654 646
            rm_ac3_swap_bytes(st, pkt);

Also available in: Unified diff