Eureka !

I think I have tracked down the problem with the XvMC VLD breaking on
channel changes with TS streams.

I am no expert on libavformat or libavcodec, so some of the following
may not be correct ...

It appears that when the AVCodec is re-created on the TS stream changing
PID's it fails to re-create the MPEG parser to go along with it.
This results in the MPEG decoder getting a RAW stream rather than a
parsed stream. This breaks the AVCodec and then the VLD output.

I enclose a patch that fixes this for the XvMC VLD decoding and
prints an Error message whenever a parser cannot be created for
a Codec. I have also added an exit(1) in this case just so people are not
misled, however this may need to be removed ....

I suspect that the CODEC ID's for the standard XVMC and many other Codecs
will need to be added to the parser.c as well as I would have thought that
all of those not in the basic set (which is mainly software MPEG) would
fail similarly.

Actually, from my looking at libavcodec and libavformat it appears that
there is a bit of a miss use of the Codec ID. It appears, in some cases
to be used as a specific Codec ID and in other cases as a generic MPEG2
Codec identifier.
In fact there are some cases in the libavformat and libavcodec code
where the Codec ID is hard set to CODEC_ID_MPEG2VIDEO even if another Codec
is in use. (See: parser.c:389, mpegts.c:776, mpeg12.c:2174 etc).
I think this needs a look at by someone in the know ....

Anyway this patch works with MythTv CVS 2005-04-25.

I note that in the current CVS 2005-04-29 it does work, but the Video/Audio
AvSync has major issues with huge stutters. I presume this is due
to videoout_xv.c changes ....

Terry


-- Dr Terry Barnaby BEAM Ltd Phone: +44 1454 324512 Northavon Business Center, Dean Rd Fax: +44 1454 313172 Yate, Bristol, BS37 5NH, UK Email: [EMAIL PROTECTED] Web: www.beam.ltd.uk BEAM for: Visually Impaired X-Terminals, Parallel Processing, Software "Tandems are twice the fun !"

Index: libs/libavcodec/parser.c
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libavcodec/parser.c,v
retrieving revision 1.10
diff -u -r1.10 parser.c
--- libs/libavcodec/parser.c	1 Feb 2005 05:09:30 -0000	1.10
+++ libs/libavcodec/parser.c	29 Apr 2005 16:42:23 -0000
@@ -811,7 +811,11 @@
 #endif
 
 AVCodecParser mpegvideo_parser = {
-    { CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO },
+    { CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO,
+#ifdef USING_XVMC_VLD
+        CODEC_ID_MPEG2VIDEO_XVMC_VLD,
+#endif
+    },
     sizeof(ParseContext1),
     NULL,
     mpegvideo_parse,
@@ -843,3 +847,4 @@
     NULL,
 };
 #endif
+
Index: libs/libavformat/utils.c
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libavformat/utils.c,v
retrieving revision 1.33
diff -u -r1.33 utils.c
--- libs/libavformat/utils.c	28 Apr 2005 14:43:07 -0000	1.33
+++ libs/libavformat/utils.c	29 Apr 2005 16:42:26 -0000
@@ -900,6 +900,8 @@
                     if (!st->parser) {
                         /* no parser available : just output the raw packets */
                         st->need_parsing = 0;
+			av_log(s, AV_LOG_ERROR, "Parser not found for Codec Id: %d !\n", st->codec.codec_id);
+			exit(1);
                     }
 		}
 	    }
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to