Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Dev

Re: [mythtv-commits] Re: Ticket #868: [8350] breaks mpeg2 decoding during frame advance

 

 

MythTV dev RSS feed   Index | Next | Previous | View Threaded


danielk at cuymedia

Dec 26, 2005, 3:31 PM

Post #1 of 5 (751 views)
Permalink
Re: [mythtv-commits] Re: Ticket #868: [8350] breaks mpeg2 decoding during frame advance

On Mon, 2005-12-26 at 03:59 +0000, ijr wrote:
> #868: [8350] breaks mpeg2 decoding during frame advance
> When you call avcodec_flush_buffers, it doesn't just flush the buffers, it
> resets the entire decoder state, even parsing. This simply cannot be
> called after a seek, unless we're decoding a keyframe next.

I'll audit every Reset request in the NVP tomorrow and make sure it
makes sense.

> Part of the issue also could be the change to the 'skipframes' loop. For
> exact seeking, we need to actually decode those frames so it can
> successfully decode and display something in the middle of a gop, and that
> loop looks like it is no longer doing so.

This was the first thing I thought might be the problem. But while
it looks like it is a bug, it isn't causing this problem; the bug
bjm reported is present on a single frame FF right after a keyframe,
this loop isn't used in that case but we do add two frames to available
which avlib hasn't returned yet.

> The change to AVFD::Reset(bool, bool)'s call of SeekReset to flush frames
> is also likely wrong - that's called after what should be a seamless file
> change, so it certainly shouldn't be flushing the decoder.

I'll check this.

> I don't think the HandleStreamChange callback should be flushing out the
> video frames, either.

I think this is needed until I implement the seamless video frame
resize. The old frames need to be completely freed from libav use
so that new ones can be allocated of that are the right resolution
for the new streams. mpegts.c really needs to output another stream
which tells MythTV about new PMT's just after the last packet from
the old streams and before the first packet from a new streams.
Then we can get rid of the old buffers on a frame by frame basis
as we finish with them.

-- Daniel


lists at wildgooses

Dec 27, 2005, 4:42 AM

Post #2 of 5 (749 views)
Permalink
Re: Re: [mythtv-commits] Re: Ticket #868: [8350] breaks mpeg2 decoding during frame advance [In reply to]

>I think this is needed until I implement the seamless video frame
>resize. The old frames need to be completely freed from libav use
>so that new ones can be allocated of that are the right resolution
>for the new streams. mpegts.c really needs to output another stream
>which tells MythTV about new PMT's just after the last packet from
>the old streams and before the first packet from a new streams.
>Then we can get rid of the old buffers on a frame by frame basis
>as we finish with them.
>
>

That might be a good place to move the reset of the aspect ratio in the
frontend as well. At the moment it changes the aspect ratio when it's
decoded rather than when it's actually presented to the output device
(so it changes aspect a few frames too soon)

Ed W
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


danielk at cuymedia

Dec 27, 2005, 2:48 PM

Post #3 of 5 (722 views)
Permalink
Re: Re: [mythtv-commits] Re: Ticket #868: [8350] breaks mpeg2 decoding during frame advance [In reply to]

On Mon, 2005-12-26 at 18:31 -0500, Daniel Kristjansson wrote:
> On Mon, 2005-12-26 at 03:59 +0000, ijr wrote:

> > The change to AVFD::Reset(bool, bool)'s call of SeekReset to flush frames
> > is also likely wrong - that's called after what should be a seamless file
> > change, so it certainly shouldn't be flushing the decoder.
> I'll check this.
This is actually never being called.

This is supposed to be called in NVP::ResetPlaying(), right?

-- Daniel


ijr at case

Dec 27, 2005, 4:05 PM

Post #4 of 5 (729 views)
Permalink
Re: Re: [mythtv-commits] Re: Ticket #868: [8350] breaks mpeg2 decoding during frame advance [In reply to]

On Tuesday 27 December 2005 17:48, Daniel Kristjansson wrote:
> On Mon, 2005-12-26 at 18:31 -0500, Daniel Kristjansson wrote:
> > On Mon, 2005-12-26 at 03:59 +0000, ijr wrote:
> > > The change to AVFD::Reset(bool, bool)'s call of SeekReset to flush
> > > frames is also likely wrong - that's called after what should be a
> > > seamless file change, so it certainly shouldn't be flushing the
> > > decoder.
> >
> > I'll check this.
>
> This is actually never being called.
>
> This is supposed to be called in NVP::ResetPlaying(), right?

No, from NVP::FileChangedCallback(). Easy way to see it should be to just
make TVRec switch files every 30 seconds in livetv (change the check that's
looking at the recendts per the comments in tv_rec.cpp). You shouldn't be
able to tell where the file changes are.

Isaac


danielk at cuymedia

Dec 27, 2005, 5:10 PM

Post #5 of 5 (730 views)
Permalink
Re: Re: [mythtv-commits] Re: Ticket #868: [8350] breaks mpeg2 decoding during frame advance [In reply to]

On Tue, 2005-12-27 at 19:05 -0500, Isaac Richards wrote:
> On Tuesday 27 December 2005 17:48, Daniel Kristjansson wrote:
> > On Mon, 2005-12-26 at 18:31 -0500, Daniel Kristjansson wrote:
> > > On Mon, 2005-12-26 at 03:59 +0000, ijr wrote:
> > > > The change to AVFD::Reset(bool, bool)'s call of SeekReset to flush
> > > > frames is also likely wrong - that's called after what should be a
> > > > seamless file change, so it certainly shouldn't be flushing the
> > > > decoder.

> No, from NVP::FileChangedCallback(). Easy way to see it should be to just
> make TVRec switch files every 30 seconds in livetv (change the check that's
> looking at the recendts per the comments in tv_rec.cpp). You shouldn't be
> able to tell where the file changes are.

Ok, this is definitely broken at the moment...

I believe I have a proper fix for the problem Bruce reported,
but I haven't tested it on MPEG4 recordings yet.

-- Daniel

MythTV dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.