]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec_amr.c
Interpret valueless attributes in AMR ftmp lines as being 1
[ffmpeg] / libavformat / rtpdec_amr.c
index 3bb7913609703ba56fdc10fa8d8ffa9083fa11f6..cbf9f28d02cc83772de3bf8481bb079321b21687 100644 (file)
@@ -141,7 +141,16 @@ static int amr_parse_sdp_line(AVFormatContext *s, int st_index,
         while (*p && *p != ' ') p++; /* eat protocol identifier */
         while (*p && *p == ' ') p++; /* strip trailing spaces */
 
-        while (rtsp_next_attr_and_value(&p, attr, sizeof(attr), value, sizeof(value))) {
+        while (ff_rtsp_next_attr_and_value(&p, attr, sizeof(attr), value, sizeof(value))) {
+            /* Some AMR SDP configurations contain "octet-align", without
+             * the trailing =1. Therefore, if the value is empty,
+             * interpret it as "1".
+             */
+            if (!strcmp(value, "")) {
+                av_log(s, AV_LOG_WARNING, "AMR fmtp attribute %s had "
+                                          "nonstandard empty value\n", attr);
+                strcpy(value, "1");
+            }
             if (!strcmp(attr, "octet-align"))
                 octet_align = atoi(value);
             else if (!strcmp(attr, "crc"))