Opened 14 years ago

Closed 14 years ago

#861 closed defect (fixed)

Attempted call to videoOutput->DiscardFrames() triggered by NVP::OpenFile() which is before videoOutput is initialized

Reported by: jwestfall@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

Got a different crash, will attach a bt.

looking at the bt/code the issue is in ClassicCommDetector::go(). Its calling nvp->OpenFile?() before nvp->InitVideo?() and there exists a code path where NuppelVideoPlayer::OpenFile?() calls NuppelVideoPlayer::DiscardVideoFrames? which uses the NULL videoOutput.

Attachments (3)

commcrash.txt (2.5 KB) - added by jwestfall@… 14 years ago.
bt
commflag.diff (912 bytes) - added by jwestfall@… 14 years ago.
simple patch that moves OpenFile?() after InitVideo?()
nvp.diff (587 bytes) - added by jwestfall@… 14 years ago.
updated patch per ijr request

Download all attachments as: .zip

Change History (7)

Changed 14 years ago by jwestfall@…

Attachment: commcrash.txt added

bt

Changed 14 years ago by jwestfall@…

Attachment: commflag.diff added

simple patch that moves OpenFile?() after InitVideo?()

comment:1 Changed 14 years ago by jwestfall@…

cancel that patch, it always returns unable to openfile.

comment:2 Changed 14 years ago by cpinkham

Summary: mythcommflag crash.Attempted call to videoOutput->DiscardFrames() triggered by NVP::OpenFile() which is before videoOutput is initialized

This patch was invalid anyway, you can't call ClassicCommDetector::Init() before you call nvp->OpenFile?() since ClassicCommDetector::Init() calls nvp->GetVideoWidth?(), nvp->GetVideoHeight?(), and nvp->GetFrameRate?(), all of which depend on the file being opened already in order to know that information.

If NVP::OpenFile?() can trigger a call to NVP::DiscardVideoFrames?() somehow, then that needs to be fixed somehow. Even NVP::StartPlaying?() calls NVP::OpenFile?() before calling NVP::InitVideo?(). NVP::InitVideo?() must be called after NVP::Openfile() since InitVideo? needs to know the video's height and width. So, we need to prevent calls to videoOutput before we've initialized video. You should be able to wrap the call to videoOutput->DiscardFrames?() with a "if (videoOutput)" to fix the issue you're seeing.

Can you try reversing your patch and patching NVP as I indicated and seeing if that fixes your issue? Calling NVP::InitVideo?() first is not an option so we need to prevent attempted calls accessing videoOutput until it is initialized. From the looks of it, I don't see how this doesn't fail when trying to play the video also since the normal player opens the file first then initializes video later.

comment:3 Changed 14 years ago by jwestfall

As suggested I did the if(videoOutput) and it fixed the issue.

Changed 14 years ago by jwestfall@…

Attachment: nvp.diff added

updated patch per ijr request

comment:4 Changed 14 years ago by cpinkham

Resolution: fixed
Status: newclosed

(In [8375]) Fix crash reported by Jim Westfall by applying his patch. Closes #861. Basically, don't try using videoOutput when it's not initialized yet in a couple places.

Note: See TracTickets for help on using tickets.