[mythtv] [PATCH] Partial fix for mythtranscode segfault

Kenneth Aafl°y ke-aa at frisurf.no
Tue Dec 2 14:15:11 EST 2003


On Tue, 2003-12-02 at 19:40, Geoffrey Hausheer wrote:
> On Tue, 02 Dec 2003 16:37:39 +0100, "Kenneth Aafl°y" said:
> > On Tue, 2003-12-02 at 15:41, Geoffrey Hausheer wrote:
> > > Need to be careful, as we need to be monotonically increasing.  So if we
> > > guess to far, we don't solve the problem.
> > 
> > While looking at avformatdecoder.cpp:
> > 
> > There is a lock around avcodec_decode_video, but not around
> > avcodec_decode_audio?
> > 
> > lastapts/temppts is calculated, shouldn't pkt->pts be used if available?
> > 
> > If the stream has b-frames, every non-b-frame will receive the previous
> > value of a non-b-frame?
> > 
> >                    long long temppts = pts;
> > 
> >                     if (context->has_b_frames && mpa_pic.pict_type !=
> > FF_B_TYPE)
> >                     {
> >                         temppts = video_last_P_pts;
> >                         video_last_P_pts = pts;
> >                     }
> > 
> >                     if (temppts != 0)
> >                         lastvpts = temppts;
> >                     else
> >                         temppts = lastvpts;
> 
> You may be right that we can use the audio frame timecodes, but note that
> lastvpts gets incremented by 1000/fps each frame, so each video frame is
> currently gauranteed to get a monotonically increasing value (unless
> lastvpts gets reset to 0 as happens here)

Just a guess, but would changing the line with mpa_pic.pict_type !=
FF_B_TYPE above to mpa_pict_type == FF_B_TYPE solve it?

Kenneth



More information about the mythtv-dev mailing list