This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Getting garbage and errors on stdin

I know this is a long shot, but I figured I'd throw it up for suggestions.  I'm encoding and decoding H264 on the DM368 chip and getting some strange errors wrt stdin.

When I open the h264 encode and the call to Venc1_create fails (from a no video input error for example), I then get bad file handle errors (errno=9) on fgets using stdin.  I figured I might be doing something bad wrt a pointer and I'm not too concerned about this.  But...

On the decode side I'm getting worse issues.  When the decoder successfully is working I sometimes get a continuous string of bytes (seemingly random) coming from stdin.  I was wondering if anyone has encountered this problem and tell me what was the problem in their case.  In the meantime I will look for the possibility of writing with a bad point or overwriting memory in error.

Thanks,

John A

  • Well, it turns out that I can answer my own question.

    In my code where I open the socket for the incoming video stream, I check the socket handle and close it if it's not -1, which indicates a closed socket in my code.  The problem was I didn't initialize the value of the handle when I create my class.  So I was calling closesocket with a random handle.  Apparently that does nasty things to the I/O subsystem.

    John A