Broken interrupt callback

Any other question that don't fit into the other support categorizes.
Post Reply
ispysoftware
Posts: 2
Joined: Sat Jun 22, 2013 8:33 am

Broken interrupt callback

Post by ispysoftware »

Hello, firstly thanks for providing the windows shared/static libraries. I'm using them in my project ispy.

I've recently updated ispy to use the latest version of ffmpeg - i've noticed that the current build (and builds as far back as october 2012) don't detect broken streams or non-existent streams. I've tracked it down to an issue with

avformat_open_input

For example:

Code: Select all

AVFormatContext* formatContext = libffmpeg::avformat_alloc_context( );
formatContext->probesize = 1000000;
formatContext->interrupt_callback.callback = interrupt_cb;
formatContext->interrupt_callback.opaque = formatContext;

if ( libffmpeg::avformat_open_input( &formatContext, fileName, NULL, &options ) !=0 )
{
	return NULL;
}
If called with a non-existant stream, like say fileName="http://192.168.1.5/videostream.asf" - or if the network connection is interrupted whilst playing - it will hang - the interrupt is never called to check whether to abort. If I call avio_open2 directly then it does call the interrupt and will exit but unfortunately that is no use to me.


I've tracked it down to a breaking change between 2 versions of ffmpeg, one that works (breaks on a non-existent stream which means the interrupt is working) from Oct 5, 2012 and the next doesn't - Oct 9, 2012. Both are built with the exact same configuration:

Code: Select all

D:\Projects\ffmpeg\test1>ffplay http://192.168.1.5/videostream.asf
ffplay version N-45080-gd9dfe9a Copyright (c) 2003-2012 the FFmpeg developers
  built on Oct  5 2012 16:47:17 with gcc 4.7.1 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3
 --disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib
--enable-frei0r --enable-libass --enable-libcelt --enable-libopencore-amrnb --en
able-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame
--enable-libnut --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enab
le-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 73.102 / 51. 73.102
  libavcodec     54. 63.100 / 54. 63.100
  libavformat    54. 29.105 / 54. 29.105
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 19.102 /  3. 19.102
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
http://192.168.1.5/videostream.asf: Input/output error
(That WORKS - the interrupt is fired and it errors out after a timeout)

Code: Select all

D:\Projects\ffmpeg\test2>ffplay http://192.168.1.5/videostream.asf
ffplay version N-45220-gf3f35f7 Copyright (c) 2003-2012 the FFmpeg developers
  built on Oct  9 2012 20:02:43 with gcc 4.7.1 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3
 --disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib
--enable-frei0r --enable-libass --enable-libcelt --enable-libopencore-amrnb --en
able-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame
--enable-libnut --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enab
le-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 74.100 / 51. 74.100
  libavcodec     54. 65.100 / 54. 65.100
  libavformat    54. 31.100 / 54. 31.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 19.102 /  3. 19.102
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
(That HANGS - interrupt is ignored and you have to force-close the application)


-so something changed between the build on Oct 5th and Oct 9th 2012 that broke the interrupt logic on the windows build. What that was I have no idea - any suggestions?

Ticket on ffmpeg boards:

https://ffmpeg.org/trac/ffmpeg/ticket/2694#comment:14

rogerdpack
Posts: 1878
Joined: Fri Aug 05, 2011 9:56 pm

Re: Broken interrupt callback

Post by rogerdpack »

appears this was fixed, or not?

ispysoftware
Posts: 2
Joined: Sat Jun 22, 2013 8:33 am

Re: Broken interrupt callback

Post by ispysoftware »

Still not working for me :( I'm just relying on the socket timeouts.

Post Reply