!! Code Changes !!.txt 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. "vpx_ports/arm_cpudetect.c"
  2. #elif defined __APPLE__
  3. int arm_cpu_caps(void) {return HAS_EDSP|HAS_MEDIA|HAS_NEON;}
  4. "vpx_ports/x86.h"
  5. FROM:
  6. #if defined(_MSC_VER) && _MSC_VER >= 1700
  7. #undef NOMINMAX
  8. #define NOMINMAX
  9. #ifndef WIN32_LEAN_AND_MEAN
  10. #define WIN32_LEAN_AND_MEAN
  11. #endif
  12. #include <windows.h>
  13. #if WINAPI_FAMILY_PARTITION(WINAPI_FAMILY_APP)
  14. #define getenv(x) NULL
  15. #endif
  16. #endif
  17. TO:
  18. #define getenv(x) NULL
  19. "third_party\libyuv\source\cpu_id.cc":
  20. FROM:
  21. #if !defined(__native_client__) && !defined(_M_ARM)
  22. TO:
  23. #if !defined(__native_client__) && !defined(_M_ARM) && 0
  24. "webmdec.cc":
  25. FROM:
  26. mkvparser::MkvReader *const reader = new mkvparser::MkvReader(vpx_ctx->file);
  27. TO:
  28. mkvparser::IMkvReader *reader = (mkvparser::IMkvReader*)webm_ctx->reader; // ESENTHEL CHANGED 'reader' is just read from webm
  29. AND
  30. FROM:
  31. rewind(vpx_ctx->file);
  32. TO:
  33. if(vpx_ctx->file)rewind(vpx_ctx->file); // ESENTHEL CHANGED
  34. AND
  35. FROM:
  36. webm_ctx->buffer = *buffer;
  37. TO:
  38. //webm_ctx->buffer = *buffer; ESENTHEL CHANGED this shouldn't be copied because it's not used for the 'webm_ctx' anywhere, also this would cause a crash because the 'buffer' will already be released in the 'webm_guess_framerate' and 'webm_ctx->buffer' would point to invalid data !!
  39. AND
  40. REPLACE ENTIRE FUNCTION:
  41. int webm_guess_framerate(struct WebmInputContext *webm_ctx,
  42. struct VpxInputContext *vpx_ctx) {
  43. uint32_t i = 0;
  44. uint8_t *buffer = NULL;
  45. uint64_t first = 0; // ESENTHEL CHANGED
  46. size_t buffer_size = 0;
  47. while (webm_ctx->timestamp_ns < 1000000000 && i < 1+3) { // ESENTHEL CHANGED process first frame and ignore it, after that check next 3 frames, because for 30.0 fps the time stamps were "33, 33, 34" (for 100 total) so we need to stop at the right time
  48. if (webm_read_frame(webm_ctx, &buffer, &buffer_size)) {
  49. break;
  50. }
  51. ++i;
  52. if(!first)first=webm_ctx->timestamp_ns; // ESENTHEL CHANGED
  53. }
  54. // ignore the first frame because it can start at an offset
  55. vpx_ctx->framerate.numerator = (i-1) * 1000000;
  56. vpx_ctx->framerate.denominator = static_cast<int>((webm_ctx->timestamp_ns-first) / 1000);
  57. delete[] buffer;
  58. get_first_cluster(webm_ctx);
  59. webm_ctx->block = NULL;
  60. webm_ctx->block_entry = NULL;
  61. webm_ctx->block_frame_index = 0;
  62. webm_ctx->timestamp_ns = 0;
  63. webm_ctx->reached_eos = 0;
  64. return 0;
  65. }
  66. ".gitignore"
  67. REMOVE THE FOLLOWING LINE
  68. /vpx_config.h