aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-10 13:07:19 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-10 13:07:25 +0100
commit91da6b97c7fb13322faf3dc7f6f895a3e363cdee (patch)
tree2ef20ebe1e2b9ab77b03766b70945be5c1bc4e5c
parentb563afe6fa9345a62750055998a28a3926c02334 (diff)
parent76c40fbef06aaf5013450a4b51dd3c49955777a1 (diff)
downloadffmpeg-91da6b97c7fb13322faf3dc7f6f895a3e363cdee.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: rtpdec_vp8: Don't trim too much data from broken frames rtpdec_vp8: Simplify code by using an existing helper function Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/rtpdec_vp8.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/libavformat/rtpdec_vp8.c b/libavformat/rtpdec_vp8.c
index 6f4e4e064a..623d3599f5 100644
--- a/libavformat/rtpdec_vp8.c
+++ b/libavformat/rtpdec_vp8.c
@@ -200,7 +200,6 @@ static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8,
int ret = ff_rtp_finalize_packet(pkt, &vp8->data, st->index);
if (ret < 0)
return ret;
- pkt->size = vp8->first_part_size;
pkt->flags |= AV_PKT_FLAG_CORRUPT;
returned_old_frame = 1;
old_timestamp = vp8->timestamp;
@@ -225,11 +224,8 @@ static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8,
if (vp8->timestamp != *timestamp) {
// Missed the start of the new frame, sequence broken
- vp8->sequence_ok = 0;
- av_log(ctx, AV_LOG_WARNING,
- "Received no start marker; dropping frame\n");
- vp8_free_buffer(vp8);
- return AVERROR(EAGAIN);
+ return vp8_broken_sequence(ctx, vp8,
+ "Received no start marker; dropping frame\n");
}
if (seq != expected_seq) {
@@ -250,7 +246,8 @@ static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8,
return vp8_broken_sequence(ctx, vp8, "Received no start marker\n");
vp8->prev_seq = seq;
- avio_write(vp8->data, buf, len);
+ if (!vp8->broken_frame)
+ avio_write(vp8->data, buf, len);
if (returned_old_frame) {
*timestamp = old_timestamp;
@@ -262,8 +259,6 @@ static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8,
ret = ff_rtp_finalize_packet(pkt, &vp8->data, st->index);
if (ret < 0)
return ret;
- if (vp8->broken_frame)
- pkt->size = vp8->first_part_size;
if (vp8->sequence_dirty)
pkt->flags |= AV_PKT_FLAG_CORRUPT;
return 0;