Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. public unsafe VLCMediaTrackInfo[] MediaTrackInfo
  2. {
  3. get
  4. {
  5. if (!IsParsed)
  6. Parse();
  7.  
  8. VLCMediaTrackInfo* mti = null;
  9.  
  10. int count = Environment.Is64BitProcess
  11. ? NativeMethods.libvlc_media_get_tracks_info64(ObjectHandle, &mti)
  12. : NativeMethods.libvlc_media_get_tracks_info32(ObjectHandle, &mti);
  13.  
  14. VLCMediaTrackInfo[] result = new VLCMediaTrackInfo[count];
  15.  
  16. int structSize = Marshal.SizeOf<VLCMediaTrackInfo>();
  17. int myStructSize = VLCMediaTrackInfo.Size;
  18.  
  19. for (int i = 0; i < count; i++)
  20. {
  21. VLCMediaTrackInfo* testPtrValue = mti + i * sizeof(VLCMediaTrackInfo);
  22. VLCMediaTrackInfo* truePtrValue = &mti[i];
  23. if (testPtrValue != truePtrValue)
  24. {
  25. long diffPtrValues = testPtrValue - truePtrValue; // Тут ловлю когда указатель имеет не верный адрес.
  26. }
  27.  
  28. result[i] = *testPtrValue;
  29. }
  30.  
  31. NativeMethods.libvlc_free(mti);
  32.  
  33. return result;
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement