Attached is the patch that corrects this problem. Thank you for your patience.

Robert W. Fuller wrote:
I'll be damned. That IS the problem. My LPCM data happens to look like MPEG_AUDIO. Ok so here's the deal, the following code in interact.cpp needs to be re-arranged so LPCM comes first since LPCM is determined by stream name rather than contents (this will avoid misidentifying LPCM data as something else when it happens to look like something else.) I will submit a patch.

if( MPAStream::Probe( *bs ) )
        {
            mjpeg_info ("File %s looks like an MPEG Audio stream.",
                        bs->StreamName() );
            bs->UndoChanges( undo );
            streams.push_back( new JobStream( bs, MPEG_AUDIO) );
            ++audio_tracks;
            continue;
        }

        bs->UndoChanges( undo );
        if( AC3Stream::Probe( *bs ) )
        {
            mjpeg_info ("File %s looks like an AC3 Audio stream.",
                        bs->StreamName());
            bs->UndoChanges( undo );
            streams.push_back( new JobStream( bs, AC3_AUDIO) );
            ++audio_tracks;
            continue;
        }

        bs->UndoChanges( undo );
        if( DTSStream::Probe( *bs ) )
        {
            mjpeg_info ("File %s looks like a dts Audio stream.",
                        bs->StreamName());
            bs->UndoChanges( undo);
            streams.push_back( new JobStream( bs, DTS_AUDIO) );
            ++audio_tracks;
            continue;
        }

        bs->UndoChanges( undo);
        if( LPCMStream::Probe( *bs ) )
        {
            mjpeg_info ("File %s looks like an LPCM Audio stream.",
                        bs->StreamName());
            bs->UndoChanges( undo );
            streams.push_back( new JobStream( bs,  LPCM_AUDIO) );
            ++audio_tracks;
            ++lpcm_tracks;
            continue;
        }

Robert W. Fuller wrote:

This is getting long. My command line is "mplex -W mplayer_hdr -r10200 -f8 substance.m1v audio.lpcm -o video.mpg." Ordinarily, this works. However, there is something about the contents of audio.lpcm that is causing mplex to misidentify this particular audio stream as MPEG_AUDIO rather than LPCM_AUDIO. This results in the floating point exception in mpastrm_in.cpp.

Unlikely though it seems, by pure coincidence my audio.lpcm happens to have data that looks like an MPEG_AUDIO header? Note that I created this lpcm file with sox as usual: "sox audio.wav -r 48000 -w -c 2 -s -x audio.raw; mv audio.raw audio.lpcm." This is an extraordinary coincidence perhaps?

Robert W. Fuller wrote:

Ok it's not a function of the file size.

Huh.  I don't get it.  Any ideas?

Robert W. Fuller wrote:

Now I'm truly baffled. This seems to be a function of the size of the LPCM file. With this file size, I get the FP exception:

-rw-r--r--  1 edison users   430811612 Jun 19 01:04 audio.lpcm

If I mock up a dummy lpcm file with something like "echo foo >bar.lpcm", then mplex gets past printing out the header info.

Robert W. Fuller wrote:

Okay so here's the deal. It's doing a division by zero. version_id is 3 and frequency is 3. That corresponds to 0 in mpa_freq_table.

Isn't Gentoo cool? I've built my entire system with the -g flag for debugging.

static const int mpa_freq_table [4][4] =
{
    /* MPEG audio V2.5 */
    {11025,12000,8000,0},
    /* RESERVED */
    { 0, 0, 0, 0 },
    /* MPEG audio V2 */
    {22050,24000, 16000,0},
    /* MPEG audio V1 */
    {44100, 48000, 32000, 0}
};


Robert W. Fuller wrote:

I'm getting a floating point exception in mplex at the following line in mpastrm_in.cpp:

    framesize =
        mpa_bitrates_kbps[version_id][layer][bit_rate_code]  *
        mpa_slots[layer] *1000 /
        mpa_freq_table[version_id][frequency];

The sum of the audio and video files exceeds 2 GB. Is that the problem? If so, how should I split this up?


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users




-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users




-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users






-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

diff -cr mjpeg_play-old/mplex/interact.cpp mjpeg_play-new/mplex/interact.cpp
*** mjpeg_play-old/mplex/interact.cpp   Tue Jun  1 10:20:40 2004
--- mjpeg_play-new/mplex/interact.cpp   Sat Jun 19 11:06:36 2004
***************
*** 131,136 ****
--- 131,148 ----
          bs = inputs[i];
          // Remember the streams initial state...
          bs->PrepareUndo( undo );
+         if( LPCMStream::Probe( *bs ) )
+         {
+             mjpeg_info ("File %s looks like an LPCM Audio stream.",
+                         bs->StreamName());
+             bs->UndoChanges( undo );
+             streams.push_back( new JobStream( bs,  LPCM_AUDIO) );
+             ++audio_tracks;
+             ++lpcm_tracks;
+             continue;
+         }
+ 
+         bs->UndoChanges( undo );
          if( MPAStream::Probe( *bs ) )
          {
              mjpeg_info ("File %s looks like an MPEG Audio stream.", 
***************
*** 163,181 ****
              continue;
          }
  
-         bs->UndoChanges( undo);
-         if( LPCMStream::Probe( *bs ) )
-         {
-             mjpeg_info ("File %s looks like an LPCM Audio stream.",
-                         bs->StreamName());
-             bs->UndoChanges( undo );
-             streams.push_back( new JobStream( bs,  LPCM_AUDIO) );
-             ++audio_tracks;
-             ++lpcm_tracks;
-             continue;
-         }
          bs->UndoChanges( undo );
- 
          if( VideoStream::Probe( *bs ) )
          {
              mjpeg_info ("File %s looks like an MPEG Video stream.",
--- 175,181 ----

Reply via email to