owaisawan / xuggle

Automatically exported from code.google.com/p/xuggle
0 stars 0 forks source link

IContainer.open crashes with access violation in native code #246

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

The crashes occur sporadically when I open mp4-Files (see attachment). In my 
application mp4 files are opened successively. They are parts of one longer 
multi-video-stream.

Before opening a new container, I close the old one:

if (container != null && container.isOpened()) {
  for (int i=0; i<container.getNumStreams(); i++) {
    if (coder[i] != null)
      coder[i].close();
  }
  container.close();
}
container = IContainer.make();
if (container.open(fileName, IContainer.Type.READ, null) < 0) {
  throw new IllegalArgumentException("could not open file: " + fileName);
}

There is no other thread active, that uses the Xuggler library.

What operating system and JVM version are you using.

Windows XP with Java 1.6.0_18, Xuggler 4.0.1023

Attach relevant log/output files.

1st attachment: The Java error log file
2nd attachment: Sample mp4 file

Original issue reported on code.google.com by arnd.e...@iav.de on 3 Aug 2010 at 12:33

Attachments:

GoogleCodeExporter commented 9 years ago
The crash is reproducable with the following code. Seems to be a problem with 
one of the files. However, it opens about 15 times (each file) before it 
crashes.

Sorry, that I have to make another post for a second file attachment.

String fileName1 = new String("D:\\MMLogger_bin\\test_20100802_142929_003.mp4");
String fileName2 = new String("D:\\MMLogger_bin\\test_20100802_142929_004.mp4");
String fileName;
IContainer container = null;
IStreamCoder coder[] = null;
for (int j=0; j<200; j++) {
  if (j%1 == 0)
    fileName = fileName1;
  else
    fileName = fileName2;
  if (container != null && container.isOpened()) {
    for (int i=0; i<container.getNumStreams(); i++) {
      if (coder[i] != null)
        coder[i].close();
    }
    container.close();
  }
  container = IContainer.make();

  if (container.open(fileName, IContainer.Type.READ, null) < 0) {
    throw new IllegalArgumentException("could not open file: " + fileName);
  }
  coder = new IStreamCoder[container.getNumStreams()];
  for (int i=0; i<container.getNumStreams(); i++) {
    IStream stream = container.getStream(i);
    IStreamCoder streamCoder = stream.getStreamCoder();
    if (streamCoder != null) {
      System.out.println(j + ": testInit() -> stream");
      coder[i] = streamCoder;
      if (coder[i].open() < 0)
        throw new RuntimeException("could not open video decoder for container: " +fileName);
    }
  }
}

Original comment by arnd.e...@iav.de on 3 Aug 2010 at 1:09

Attachments:

GoogleCodeExporter commented 9 years ago
another sample file ...

Original comment by arnd.e...@iav.de on 3 Aug 2010 at 1:11

Attachments:

GoogleCodeExporter commented 9 years ago
After some more testing it figured out that test_20100802_142929_003.mp4 is the 
file where the error occurs. It is a file with an empty video stream.
I think this should not make the xuggler crash.

Original comment by arnd.e...@iav.de on 6 Aug 2010 at 7:54

GoogleCodeExporter commented 9 years ago
Did your issue got fixed on windows? I have the same issue. Thanks.

Original comment by feng...@gmail.com on 5 Apr 2012 at 7:40

GoogleCodeExporter commented 9 years ago
I never got any answer. I wonder if anyone reads the bug reports. However, I 
found a solution (for my case) where the error should not occur any more, 
because I am no longer producing empty streams.

Original comment by arnd.e...@googlemail.com on 9 May 2012 at 8:09

GoogleCodeExporter commented 9 years ago
How did you fix it?

Original comment by monstrf...@gmail.com on 20 Jan 2015 at 4:10

GoogleCodeExporter commented 9 years ago
The problem ocurred when I opened files with empty streams. In my case I could 
just change the generation of the video files not to produce empty streams.

Original comment by arnd.e...@googlemail.com on 21 Jan 2015 at 10:18