[mythtv] New MPEG2 commercial-cut code ready for testing

Geoffrey Hausheer mythtv0368 at phracturedblue.com
Tue Nov 15 11:46:58 EST 2005

On 11/15/05, Stuart Auchterlonie wrote:
> On Mon, Nov 14, 2005 at 09:29:22PM -0800, Geoffrey Hausheer wrote:
> > Here is mpeg2fix-0.9
> I now have an infinite loop that wasn't there before.
> Changes have been 0.8-0.9 and slightly different cutlist.
> Some backtraces from where it's looping
> (plus a full backtrace as an attachment)
> If you need more info let me know
Well, I know why you are getting the infinite loop, but am not sure
how that can happen, and don't know what to do about it.  Basically,
the decoder was unable to find an entire frame, and is waiting for
additional data.  If the frame is truely broken, it is impossible to
do a frame conversion, and I'm not sure how to proceed.

Can you add the following patch, and send me the resulting abort.dat
file along with the error message?
also running 'print *vf' from gdb after breaking (make sure you are in
process video) and send me that might be useful too.
--- mpeg2fix.cpp.old    2005-11-14 21:26:38.000000000 -0800
+++ mpeg2fix.cpp        2005-11-15 08:35:41.000000000 -0800
@@ -782,6 +782,10 @@
                     fprintf(stderr, "Warning: partial frame found!\n");
                     return 0;
+        } else if (state == STATE_BUFFER) {
+            write_data("abort.dat", vf->pkt.data, vf->pkt.size);
+            fprintf(stderr, "Failed to decode frame.  Position was:
%d\n", last_pos);
+            assert(state != STATE_BUFFER);

         last_pos = (vf->pkt.size - mpeg2_getpos(dec)) - 4;

More information about the mythtv-dev mailing list