diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2008-11-15 20:41:59 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2008-11-15 20:41:59 +0000 |
commit | 114732f4c72a854a3e4409d01ff0e8eb1fb2c20d (patch) | |
tree | 6250635dd386763c20bb8da3bed6e728e5a35aab /libavformat/rdt.c | |
parent | 92765276fbe0e586a8c122521c5bc2d1da9e257a (diff) | |
download | ffmpeg-114732f4c72a854a3e4409d01ff0e8eb1fb2c20d.tar.gz |
Add is_keyframe param to ff_rdt_parse_header(). See ML discussion in
"[PATCH] RDT/Realmedia patches #2" thread.
Originally committed as revision 15833 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rdt.c')
-rw-r--r-- | libavformat/rdt.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavformat/rdt.c b/libavformat/rdt.c index 766158eabe..3553cd9987 100644 --- a/libavformat/rdt.c +++ b/libavformat/rdt.c @@ -173,7 +173,8 @@ rdt_load_mdpr (PayloadContext *rdt, AVStream *st, int rule_nr) int ff_rdt_parse_header(const uint8_t *buf, int len, - int *set_id, int *seq_no, int *stream_id, uint32_t *timestamp) + int *set_id, int *seq_no, int *stream_id, + int *is_keyframe, uint32_t *timestamp) { int consumed = 10; @@ -238,7 +239,8 @@ ff_rdt_parse_header(const uint8_t *buf, int len, if (set_id) *set_id = (buf[0]>>1) & 0x1f; if (seq_no) *seq_no = AV_RB16(buf+1); if (timestamp) *timestamp = AV_RB32(buf+4); - if (stream_id) *stream_id = buf[3] & 0x3f; + if (stream_id) *stream_id = (buf[3]>>1) & 0x1f; + if (is_keyframe) *is_keyframe = !(buf[3] & 0x1); return consumed; } @@ -287,7 +289,7 @@ int ff_rdt_parse_packet(RDTDemuxContext *s, AVPacket *pkt, const uint8_t *buf, int len) { - int seq_no, flags = 0, stream_id, set_id; + int seq_no, flags = 0, stream_id, set_id, is_keyframe; uint32_t timestamp; int rv= 0; @@ -304,10 +306,10 @@ ff_rdt_parse_packet(RDTDemuxContext *s, AVPacket *pkt, if (len < 12) return -1; - rv = ff_rdt_parse_header(buf, len, &set_id, &seq_no, &stream_id, ×tamp); + rv = ff_rdt_parse_header(buf, len, &set_id, &seq_no, &stream_id, &is_keyframe, ×tamp); if (rv < 0) return rv; - if (!(stream_id & 1) && (set_id != s->prev_set_id || timestamp != s->prev_timestamp)) { + if (is_keyframe && (set_id != s->prev_set_id || timestamp != s->prev_timestamp)) { flags |= PKT_FLAG_KEY; s->prev_set_id = set_id; s->prev_timestamp = timestamp; |