]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec_amr.c
swf(dec): replace CODEC_ID with AV_CODEC_ID
[ffmpeg] / libavformat / rtpdec_amr.c
index 802e7c1ce8cc27f00be2501769b344a72a9ba0c7..cc43e31e6d12336133f3dd93f19393407381721b 100644 (file)
@@ -64,9 +64,9 @@ static int amr_handle_packet(AVFormatContext *ctx,
     const uint8_t *speech_data;
     uint8_t *ptr;
 
-    if (st->codec->codec_id == CODEC_ID_AMR_NB) {
+    if (st->codec->codec_id == AV_CODEC_ID_AMR_NB) {
         frame_sizes = frame_sizes_nb;
-    } else if (st->codec->codec_id == CODEC_ID_AMR_WB) {
+    } else if (st->codec->codec_id == AV_CODEC_ID_AMR_WB) {
         frame_sizes = frame_sizes_wb;
     } else {
         av_log(ctx, AV_LOG_ERROR, "Bad codec ID\n");
@@ -169,6 +169,9 @@ static int amr_parse_sdp_line(AVFormatContext *s, int st_index,
     const char *p;
     int ret;
 
+    if (st_index < 0)
+        return 0;
+
     /* Parse an fmtp line this one:
      * a=fmtp:97 octet-align=1; interleaving=0
      * That is, a normal fmtp: line followed by semicolon & space
@@ -189,20 +192,19 @@ static int amr_parse_sdp_line(AVFormatContext *s, int st_index,
 RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler = {
     .enc_name         = "AMR",
     .codec_type       = AVMEDIA_TYPE_AUDIO,
-    .codec_id         = CODEC_ID_AMR_NB,
+    .codec_id         = AV_CODEC_ID_AMR_NB,
     .parse_sdp_a_line = amr_parse_sdp_line,
-    .open             = amr_new_context,
-    .close            = amr_free_context,
+    .alloc            = amr_new_context,
+    .free             = amr_free_context,
     .parse_packet     = amr_handle_packet,
 };
 
 RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler = {
     .enc_name         = "AMR-WB",
     .codec_type       = AVMEDIA_TYPE_AUDIO,
-    .codec_id         = CODEC_ID_AMR_WB,
+    .codec_id         = AV_CODEC_ID_AMR_WB,
     .parse_sdp_a_line = amr_parse_sdp_line,
-    .open             = amr_new_context,
-    .close            = amr_free_context,
+    .alloc            = amr_new_context,
+    .free             = amr_free_context,
     .parse_packet     = amr_handle_packet,
 };
-