Opened 9 years ago
Closed 6 years ago
#5615 closed defect (fixed)
avformat_open_input on dead UDP source link hangs after interrupt_callback signaled exit
Reported by: | Marlon Mirchevski | Owned by: | |
---|---|---|---|
Priority: | important | Component: | avformat |
Version: | git-master | Keywords: | udp regression |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Udp source is not active.
After returning 1 from interrupt_callback (exit), avformat_open_input does not return.
Using Win32 dll from Zeranoe on W10 64bit, Microsoft compiler
2015-05-22 Working
https://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-20160522-git-566be4f-win32-shared.7z
2015-05-25 Not working
https://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-20160525-git-9591ca7-win32-shared.7z
How to reproduce:
GetTickCount used can be any time function returning miliseconds.
unsigned long TimePrev=0; //callback static int cb_open(void *ctx) { //timeout after 3 seconds if(GetTickCount() - TimePrev > 3000) { printf("---interrupt_cb: Exit\n"); return 1; } return 0; } void main() { avformat_network_init(); AVFormatContext *pFmtCtx = avformat_alloc_context(); pFmtCtx->interrupt_callback.callback = cb_open; pFmtCtx->interrupt_callback.opaque = 0; const char *url="udp://127.0.0.1:8000"; printf("avformat_open_input %s\n", url); TimePrev=GetTickCount(); int nRet=avformat_open_input(&pFmtCtx, url, NULL, NULL); //here never called
Change History (14)
follow-up: 2 comment:1 by , 8 years ago
follow-ups: 4 5 comment:2 by , 8 years ago
Replying to superware:
Can a developer please check this (old) defect?
it's very easy to reproduce...
How can the issue be reproduced?
comment:3 by , 8 years ago
Keywords: | open callback hang removed |
---|
comment:4 by , 8 years ago
Replying to cehoyos:
How can the issue be reproduced?
Hi cehoyos,
Simply open a non-existing UDP stream, such as "udp://127.0.0.1:8000", and avformat_open_input will hang even if the interrupt_callback.callback returns 1 ("During blocking operations, callback is called with opaque as parameter. If the callback returns 1, the blocking operation will be aborted.").
Actually all the details and code are supplied by Marlon above.
Thank you in advance.
comment:5 by , 8 years ago
Replying to cehoyos:
How can the issue be reproduced?
Hi cehoyos, have you managed to reproduce the bug? Thanks!
comment:7 by , 8 years ago
Keywords: | regression added |
---|---|
Priority: | normal → important |
Which change introduced the regression?
comment:8 by , 8 years ago
Thanks cehoyos.
Well, it seems Marlon found ffmpeg-20160522-git-566be4f-win32-shared.7z working but ffmpeg-20160525-git-9591ca7-win32-shared.7z not.
comment:9 by , 8 years ago
Which of the 19 commits between 566be4f and 9591ca7 caused the regression?
comment:13 by , 6 years ago
This issue is fixed in version 4.0.2 or earlier.
I have just tested 32 and 64-bit versions from Zeranoe builds:
https://ffmpeg.zeranoe.com/builds/win32/dev/ffmpeg-4.0.2-win32-dev.zip
https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-4.0.2-win64-dev.zip
on Windows 7 and 10 and it's OK.
Thanks!
comment:14 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Can a developer please check this (old) defect? it's very easy to reproduce... Thanks!