-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FFmpeg] avformat_find_stream_info crashes with two log callback set successively #683
Comments
Yes, that's a known limitation, we can't have 2 actual function pointers
from the same FunctionPointer. Do you need 2 log functions?
|
No, I just need to replace the previous log function pointer with a new one. |
What happens if you call Could you also attach the |
@saudet That implementation can't meet my need well because I need to handle logs without prefixes. |
I just want to know if |
Thanks for help. I'll check it later and try writing simple codes to reproduce this issue. |
The output is "callback2", why is this happening? |
Like I said, that's a current limitation of FunctionPointer. Don't define more than one of them. |
I think the issue is caused by this limitation. I think I have to define only one FunctionPointer which calls a outside callback function. What is this limitation caused by and can it be fixed? |
It could be fixed, but it wouldn't be that easy, and you're like the second person to have asked about this in maybe 5 years, so it's not something that a lot of people need. Details are in the code here:
https://github.com/bytedeco/javacpp/blob/master/src/main/java/org/bytedeco/javacpp/tools/Generator.java#L3058 |
I understand the difficulty. A walk-around by defining a fixed callback method should be useful. Anyway, thanks for your help. |
…the value in `@Allocator(max=...)` (issue bytedeco/javacpp-presets#683)
Since this issue is a severe limitation for CPython, I've fixed it in commit bytedeco/javacpp@86e4f2e! |
…the value in `@Allocator(max=...)` (issue bytedeco/javacpp-presets#683)
…the value in `@Allocator(max=...)` (issue bytedeco/javacpp-presets#683)
Fix included in version 1.5.1. Thanks for reporting! |
Platform: windows-x86_64
Version: 4.1-1.4.4
Codes:
https://github.com/yescallop/Aid/tree/71165f5577e3105d3178f3c3640455b09746f800/AidBase_Video/src/main/java/cn/yescallop/aid/video/Main.java
Expected result:
Actual result:
Debug stack info:
Some tests after some modifications:
If I comment out this line: https://github.com/yescallop/Aid/blob/71165f5577e3105d3178f3c3640455b09746f800/AidBase_Video/src/main/java/cn/yescallop/aid/video/device/dshow/DshowDeviceListHelper.java#L85
In other words, DshowDeviceListHelper.CALLBACK_POINTER is referenced from nowhere,
DshowDeviceListHelper.CALLBACK_POINTER.call is still being called.
It seems that when a new Callback_Pointer_int_BytePointer_Pointer instance is created, if there was another instance, the memory of the two instances would be messed up (Sorry for confusions since I've no much knowlegde about jni and C++).
If I don't call listDevices() and directly use a self-typed DeviceInfo for opening input and finding stream info, all will be fine.
The text was updated successfully, but these errors were encountered: