changeset 5863:7d952a85947b libavformat

Interpret valueless attributes in AMR ftmp lines as being 1
author mstorsjo
date Mon, 22 Mar 2010 14:44:28 +0000
parents 57fc219dc951
children 0ff0826b6c3d
files rtpdec_amr.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rtpdec_amr.c	Mon Mar 22 14:42:52 2010 +0000
+++ b/rtpdec_amr.c	Mon Mar 22 14:44:28 2010 +0000
@@ -142,6 +142,15 @@
         while (*p && *p == ' ') p++; /* strip trailing spaces */
 
         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"))