Revision 7268f0bd libavformat/rmdec.c

View differences:

libavformat/rmdec.c
710 710
    int old_flags, flags;
711 711

  
712 712
    for (;;) {
713
    if (rm->audio_pkt_cnt) {
714
        // If there are queued audio packet return them first
715
        st = s->streams[rm->audio_stream_num];
716
        ff_rm_retrieve_cache(s, s->pb, st, st->priv_data, pkt);
713
        if (rm->audio_pkt_cnt) {
714
            // If there are queued audio packet return them first
715
            st = s->streams[rm->audio_stream_num];
716
            ff_rm_retrieve_cache(s, s->pb, st, st->priv_data, pkt);
717 717
        } else {
718 718
            if (rm->old_format) {
719
        RMStream *ast;
719
                RMStream *ast;
720 720

  
721
        st = s->streams[0];
722
        ast = st->priv_data;
721
                st = s->streams[0];
722
                ast = st->priv_data;
723 723
                timestamp = AV_NOPTS_VALUE;
724 724
                len = !ast->audio_framesize ? RAW_PACKET_SIZE :
725 725
                    ast->coded_framesize * ast->sub_packet_h / 2;
726 726
                flags = (seq++ == 1) ? 2 : 0;
727
    } else {
728
        len=sync(s, &timestamp, &flags, &i, &pos);
729
        st = s->streams[i];
727
            } else {
728
                len=sync(s, &timestamp, &flags, &i, &pos);
729
                st = s->streams[i];
730 730
            }
731 731

  
732 732
            if(len<0 || url_feof(s->pb))
733 733
                return AVERROR(EIO);
734 734

  
735
        old_flags = flags;
736
        res = ff_rm_parse_packet (s, s->pb, st, st->priv_data, len, pkt,
737
                                  &seq, &flags, &timestamp);
738
        if((old_flags&2) && (seq&0x7F) == 1)
739
            av_add_index_entry(st, pos, timestamp, 0, 0, AVINDEX_KEYFRAME);
735
            old_flags = flags;
736
            res = ff_rm_parse_packet (s, s->pb, st, st->priv_data, len, pkt,
737
                                      &seq, &flags, &timestamp);
738
            if((old_flags&2) && (seq&0x7F) == 1)
739
                av_add_index_entry(st, pos, timestamp, 0, 0, AVINDEX_KEYFRAME);
740 740
            if (res)
741 741
                continue;
742 742
        }

Also available in: Unified diff