Merge commit 'ddf5fb71ee9c8b2d9a23c0f661a84896cd7050fc'
[ffmpeg.git] / libavformat / rtpenc.c
index dfaccef2e290f03d5758de06b5816b8614a358a8..c608dfb46af27e06ca1daebd582e16dcda7cd1d4 100644 (file)
@@ -202,9 +202,11 @@ static int rtp_write_header(AVFormatContext *s1)
         }
         break;
     case AV_CODEC_ID_HEVC:
-        if (st->codec->extradata_size > 21 &&
-            (st->codec->extradata[0] || st->codec->extradata[1] ||
-             st->codec->extradata[2] > 1)) {
+        /* Only check for the standardized hvcC version of extradata, keeping
+         * things simple and similar to the avcC/H264 case above, instead
+         * of trying to handle the pre-standardization versions (as in
+         * libavcodec/hevc.c). */
+        if (st->codec->extradata_size > 21 && st->codec->extradata[0] == 1) {
             s->nal_length_size = (st->codec->extradata[21] & 0x03) + 1;
         }
         break;