Advertisement
Guest User

Untitled

a guest
Nov 17th, 2010
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.87 KB | None | 0 0
  1. Index: asfdec.c
  2. ===================================================================
  3. --- asfdec.c    (revision 25760)
  4. +++ asfdec.c    (working copy)
  5. @@ -577,37 +577,44 @@
  6.                  get_str16_nolen(pb, name_len * 2, name, sizeof(name));
  7.                  ff_new_chapter(s, i, (AVRational){1, 10000000}, pres_time, AV_NOPTS_VALUE, name );
  8.              }
  9. -#if 0
  10. -        } else if (!guidcmp(&g, &ff_asf_codec_comment_header)) {
  11. -            int len, v1, n, num;
  12. -            char str[256], *q;
  13. -            char tag[16];
  14. -
  15. -            get_guid(pb, &g);
  16. -            print_guid(&g);
  17. -
  18. -            n = get_le32(pb);
  19. -            for(i=0;i<n;i++) {
  20. -                num = get_le16(pb); /* stream number */
  21. -                get_str16(pb, str, sizeof(str));
  22. -                get_str16(pb, str, sizeof(str));
  23. -                len = get_le16(pb);
  24. -                q = tag;
  25. -                while (len > 0) {
  26. -                    v1 = get_byte(pb);
  27. -                    if ((q - tag) < sizeof(tag) - 1)
  28. -                        *q++ = v1;
  29. -                    len--;
  30. -                }
  31. -                *q = '\0';
  32. -            }
  33. -#endif
  34.          } else if (url_feof(pb)) {
  35.              return -1;
  36.          } else {
  37.              if (!s->keylen) {
  38.                  if (!guidcmp(&g, &ff_asf_content_encryption)) {
  39.                      av_log(s, AV_LOG_WARNING, "DRM protected stream detected, decoding will likely fail!\n");
  40. +                    int i;
  41. +                    unsigned int len1, len2, len3, len4;
  42. +                    char drmkey[1024];
  43. +                    char license_url[1024];
  44. +                    memset(drmkey, 0, sizeof(char) * 1024);
  45. +                    memset(license_url, 0, sizeof(char) * 1024);
  46. +                    len1 = get_le32(pb);
  47. +                    url_fskip(pb, len1);
  48. +
  49. +                    /* skip "DRM" */
  50. +                    len2 = get_le32(pb);
  51. +                    assert(len2 == 4);
  52. +                    get_byte(pb);
  53. +                    get_byte(pb);
  54. +                    get_byte(pb);
  55. +                    get_byte(pb);
  56. +
  57. +                    /* drm key id */
  58. +                    len3 = get_le32(pb);
  59. +                    for(i = 0; i < len3; i++)
  60. +                    {
  61. +                        drmkey[i] = get_byte(pb);
  62. +                    }
  63. +                    av_log(NULL, AV_LOG_WARNING, "Key ID: %s\n", drmkey);
  64. +
  65. +                    /* license length */
  66. +                    len4 = get_le32(pb);
  67. +                    for(i = 0; i < len4; i++)
  68. +                    {
  69. +                        license_url[i] = get_byte(pb);
  70. +                    }
  71. +                    av_log(NULL, AV_LOG_WARNING, "License URL: %s\n", license_url);
  72.                  } else if (!guidcmp(&g, &ff_asf_ext_content_encryption)) {
  73.                      av_log(s, AV_LOG_WARNING, "Ext DRM protected stream detected, decoding will likely fail!\n");
  74.                  } else if (!guidcmp(&g, &ff_asf_digital_signature)) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement