Commit 71194ef6 authored by Martin Storsjö's avatar Martin Storsjö

rtpdec_vp8: Mark broken packets with AV_PKT_FLAG_CORRUPT

This allows the caller to either include them (and get more packets
decoded, but possibly some nonperfect frames), or discard them (by
setting fflags=discardcorrupt).
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent d744801f
...@@ -90,6 +90,8 @@ static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8, ...@@ -90,6 +90,8 @@ static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8,
if (ret < 0) if (ret < 0)
return ret; return ret;
*timestamp = vp8->timestamp; *timestamp = vp8->timestamp;
if (vp8->sequence_dirty)
pkt->flags |= AV_PKT_FLAG_CORRUPT;
return 0; return 0;
} }
return AVERROR(EAGAIN); return AVERROR(EAGAIN);
...@@ -199,6 +201,7 @@ static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8, ...@@ -199,6 +201,7 @@ static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8,
if (ret < 0) if (ret < 0)
return ret; return ret;
pkt->size = vp8->first_part_size; pkt->size = vp8->first_part_size;
pkt->flags |= AV_PKT_FLAG_CORRUPT;
returned_old_frame = 1; returned_old_frame = 1;
old_timestamp = vp8->timestamp; old_timestamp = vp8->timestamp;
} else { } else {
...@@ -261,6 +264,8 @@ static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8, ...@@ -261,6 +264,8 @@ static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8,
return ret; return ret;
if (vp8->broken_frame) if (vp8->broken_frame)
pkt->size = vp8->first_part_size; pkt->size = vp8->first_part_size;
if (vp8->sequence_dirty)
pkt->flags |= AV_PKT_FLAG_CORRUPT;
return 0; return 0;
} }
......
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