]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec_mpeg12.c
avcodec: Remove lock manager API
[ffmpeg] / libavformat / rtpdec_mpeg12.c
index b93de3d9e4da678dd2280a483cf0eaa38a45510a..e640220ebee151f587213e588baf9950cf49b6c2 100644 (file)
@@ -29,6 +29,7 @@ static int mpeg_parse_packet(AVFormatContext *ctx, PayloadContext *data,
                              int flags)
 {
     unsigned int h;
+    int ret;
     if (len <= 4)
         return AVERROR_INVALIDDATA;
     h    = AV_RB32(buf);
@@ -41,14 +42,14 @@ static int mpeg_parse_packet(AVFormatContext *ctx, PayloadContext *data,
         buf += 4;
         len -= 4;
     }
-    if (av_new_packet(pkt, len) < 0)
-        return AVERROR(ENOMEM);
+    if ((ret = av_new_packet(pkt, len)) < 0)
+        return ret;
     memcpy(pkt->data, buf, len);
     pkt->stream_index = st->index;
     return 0;
 }
 
-RTPDynamicProtocolHandler ff_mpeg_audio_dynamic_handler = {
+const RTPDynamicProtocolHandler ff_mpeg_audio_dynamic_handler = {
     .codec_type        = AVMEDIA_TYPE_AUDIO,
     .codec_id          = AV_CODEC_ID_MP3,
     .need_parsing      = AVSTREAM_PARSE_FULL,
@@ -56,7 +57,7 @@ RTPDynamicProtocolHandler ff_mpeg_audio_dynamic_handler = {
     .static_payload_id = 14,
 };
 
-RTPDynamicProtocolHandler ff_mpeg_video_dynamic_handler = {
+const RTPDynamicProtocolHandler ff_mpeg_video_dynamic_handler = {
     .codec_type        = AVMEDIA_TYPE_VIDEO,
     .codec_id          = AV_CODEC_ID_MPEG2VIDEO,
     .need_parsing      = AVSTREAM_PARSE_FULL,