]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec_vp8.c
movenc: Remove an unnecessary condition when flushing fragments
[ffmpeg] / libavformat / rtpdec_vp8.c
index b7d5345ab7ece0e0e10fc4f5f909b4d6f0e88f51..fc86ac1dd3b5d078f92ae9657151788e54a2f3ee 100644 (file)
@@ -82,7 +82,7 @@ static int vp8_handle_packet(AVFormatContext *ctx, PayloadContext *vp8,
         keyidx_present = 0;
     int pictureid = -1, pictureid_mask = 0;
     int returned_old_frame = 0;
-    uint32_t old_timestamp;
+    uint32_t old_timestamp = 0;
 
     if (!buf) {
         if (vp8->data) {
@@ -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;
@@ -247,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;
@@ -259,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;