| 912 | } |
| 913 | |
| 914 | static int64_t rm_read_dts(AVFormatContext *s, int stream_index, |
| 915 | int64_t *ppos, int64_t pos_limit) |
| 916 | { |
| 917 | RMDemuxContext *rm = s->priv_data; |
| 918 | int64_t pos, dts; |
| 919 | int stream_index2, flags, len, h; |
| 920 | |
| 921 | pos = *ppos; |
| 922 | |
| 923 | if(rm->old_format) |
| 924 | return AV_NOPTS_VALUE; |
| 925 | |
| 926 | url_fseek(s->pb, pos, SEEK_SET); |
| 927 | rm->remaining_len=0; |
| 928 | for(;;){ |
| 929 | int seq=1; |
| 930 | AVStream *st; |
| 931 | |
| 932 | len=sync(s, &dts, &flags, &stream_index2, &pos); |
| 933 | if(len<0) |
| 934 | return AV_NOPTS_VALUE; |
| 935 | |
| 936 | st = s->streams[stream_index2]; |
| 937 | if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
| 938 | h= get_byte(s->pb); len--; |
| 939 | if(!(h & 0x40)){ |
| 940 | seq = get_byte(s->pb); len--; |
| 941 | } |
| 942 | } |
| 943 | |
| 944 | if((flags&2) && (seq&0x7F) == 1){ |
| 945 | // av_log(s, AV_LOG_DEBUG, "%d %d-%d %"PRId64" %d\n", flags, stream_index2, stream_index, dts, seq); |
| 946 | av_add_index_entry(st, pos, dts, 0, 0, AVINDEX_KEYFRAME); |
| 947 | if(stream_index2 == stream_index) |
| 948 | break; |
| 949 | } |
| 950 | |
| 951 | url_fskip(s->pb, len); |
| 952 | } |
| 953 | *ppos = pos; |
| 954 | return dts; |
| 955 | } |
| 956 | |
| 957 | AVInputFormat rm_demuxer = { |
| 958 | "rm", |
nothing calls this directly
no test coverage detected