]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mxfdec.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavformat / mxfdec.c
index fb47afa5eb637f031d334fa53b143935999512e5..5cf9709a10ec9df8f3e2af1ed8fec0fcc34fb24a 100644 (file)
@@ -952,7 +952,6 @@ static int mxf_get_sorted_table_segments(MXFContext *mxf, int *nb_sorted_segment
     int i, j, nb_segments = 0;
     MXFIndexTableSegment **unsorted_segments;
     int last_body_sid = -1, last_index_sid = -1, last_index_start = -1;
-    uint64_t last_index_duration = 0;
 
     /* count number of segments, allocate arrays and copy unsorted segments */
     for (i = 0; i < mxf->metadata_sets_count; i++)
@@ -1003,7 +1002,6 @@ static int mxf_get_sorted_table_segments(MXFContext *mxf, int *nb_sorted_segment
         last_body_sid    = best_body_sid;
         last_index_sid   = best_index_sid;
         last_index_start = best_index_start;
-        last_index_duration = best_index_duration;
     }
 
     av_free(unsorted_segments);
@@ -1517,9 +1515,11 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
                     break; /* The correct thing to do here is fall through, but by breaking we might be
                               able to decode some streams at half the vertical resolution, rather than not al all.
                               It's also for compatibility with the old behavior. */
-                case SeparateFields:
                 case MixedFields:
+                    break;
+                case SeparateFields:
                     st->codec->height *= 2; /* Turn field height into frame height. */
+                    break;
                 default:
                     av_log(mxf->fc, AV_LOG_INFO, "Unknown frame layout type: %d\n", descriptor->frame_layout);
             }
@@ -2117,8 +2117,8 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
     if ((ret64 = avio_seek(s->pb, pos, SEEK_SET)) < 0)
         return ret64;
 
-        if ((ret = av_get_packet(s->pb, pkt, size)) != size)
-            return ret < 0 ? ret : AVERROR_EOF;
+    if ((size = av_get_packet(s->pb, pkt, size)) < 0)
+        return size;
 
     if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && t->ptses &&
         mxf->current_edit_unit >= 0 && mxf->current_edit_unit < t->nb_ptses) {