]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec_hevc.c
tls: Pass AVOptions dictionaries through to the chained protocol
[ffmpeg] / libavformat / rtpdec_hevc.c
index e04725be5d8ee83539790957f84ca25b7775de78..4ec9767b464c7dd7d1adb6a6f80abd1ec0196030 100644 (file)
@@ -46,7 +46,7 @@ static const uint8_t start_sequence[] = { 0x00, 0x00, 0x00, 0x01 };
 static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s,
                                               AVStream *stream,
                                               PayloadContext *hevc_data,
-                                              char *attr, char *value)
+                                              const char *attr, const char *value)
 {
     /* profile-space: 0-3 */
     /* profile-id: 0-31 */
@@ -331,24 +331,8 @@ static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx
         new_nal_header[0] = (rtp_pl[0] & 0x81) | (fu_type << 1);
         new_nal_header[1] = rtp_pl[1];
 
-        /* start fragment vs. subsequent fragments */
-        if (first_fragment) {
-            /* create A/V packet which is big enough */
-            if ((res = av_new_packet(pkt, sizeof(start_sequence) + sizeof(new_nal_header) + len)) < 0)
-                return res;
-            /* A/V packet: copy start sequence */
-            memcpy(pkt->data, start_sequence, sizeof(start_sequence));
-            /* A/V packet: copy new NAL header */
-            memcpy(pkt->data + sizeof(start_sequence), new_nal_header, sizeof(new_nal_header));
-            /* A/V packet: copy NAL unit data */
-            memcpy(pkt->data + sizeof(start_sequence) + sizeof(new_nal_header), buf, len);
-        } else {
-            /* create A/V packet */
-            if ((res = av_new_packet(pkt, len)) < 0)
-                return res;
-            /* A/V packet: copy NAL unit data */
-            memcpy(pkt->data, buf, len);
-        }
+        res = ff_h264_handle_frag_packet(pkt, buf, len, first_fragment,
+                                         new_nal_header, sizeof(new_nal_header));
 
         break;
     /* PACI packet */