Commit c13ab42a authored by Martin Storsjö's avatar Martin Storsjö

rtpdec_qt: Use a local variable instead of RTP_FLAG_KEY

The only case where RTP_FLAG_KEY actually is needed is
in RDT, where such a flag needs to be passed via the
rtpdec parse function's flags parameter.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 15621cbb
...@@ -47,7 +47,8 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt, ...@@ -47,7 +47,8 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
AVIOContext pb; AVIOContext pb;
GetBitContext gb; GetBitContext gb;
int packing_scheme, has_payload_desc, has_packet_info, alen, int packing_scheme, has_payload_desc, has_packet_info, alen,
has_marker_bit = flags & RTP_FLAG_MARKER; has_marker_bit = flags & RTP_FLAG_MARKER,
keyframe;
if (qt->remaining) { if (qt->remaining) {
int num = qt->pkt.size / qt->bytes_per_frame; int num = qt->pkt.size / qt->bytes_per_frame;
...@@ -79,8 +80,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt, ...@@ -79,8 +80,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
skip_bits(&gb, 4); // version skip_bits(&gb, 4); // version
if ((packing_scheme = get_bits(&gb, 2)) == 0) if ((packing_scheme = get_bits(&gb, 2)) == 0)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (get_bits1(&gb)) keyframe = get_bits1(&gb);
flags |= RTP_FLAG_KEY;
has_payload_desc = get_bits1(&gb); has_payload_desc = get_bits1(&gb);
has_packet_info = get_bits1(&gb); has_packet_info = get_bits1(&gb);
skip_bits(&gb, 23); // reserved:7, cache payload info:1, payload ID:15 skip_bits(&gb, 23); // reserved:7, cache payload info:1, payload ID:15
...@@ -196,7 +196,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt, ...@@ -196,7 +196,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
qt->pkt.size = 0; qt->pkt.size = 0;
qt->pkt.data = NULL; qt->pkt.data = NULL;
pkt->flags = flags & RTP_FLAG_KEY ? AV_PKT_FLAG_KEY : 0; pkt->flags = keyframe ? AV_PKT_FLAG_KEY : 0;
pkt->stream_index = st->index; pkt->stream_index = st->index;
memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE); memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
return 0; return 0;
...@@ -211,7 +211,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt, ...@@ -211,7 +211,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
if (av_new_packet(pkt, qt->bytes_per_frame)) if (av_new_packet(pkt, qt->bytes_per_frame))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
memcpy(pkt->data, buf + avio_tell(&pb), qt->bytes_per_frame); memcpy(pkt->data, buf + avio_tell(&pb), qt->bytes_per_frame);
pkt->flags = flags & RTP_FLAG_KEY ? AV_PKT_FLAG_KEY : 0; pkt->flags = keyframe ? AV_PKT_FLAG_KEY : 0;
pkt->stream_index = st->index; pkt->stream_index = st->index;
if (qt->remaining > 0) { if (qt->remaining > 0) {
av_freep(&qt->pkt.data); av_freep(&qt->pkt.data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment