Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linuxtv-softmpeg] unimportant fix



Hi everyone
I was playing with the softmpeg lib. I noticed one little problem in src/
softmpeg.c line .
The audio "stream id" has a 5 bit wide ES stream number. So it should read
"} else if (0xc0 == (ret & 0xe0))"
Also instead of assuming valid packet size in a situation where an unknown 
type pes packet type is detected. It should just continue parsing the stream. 
That makes it a little more robust.

I attached a patch as well.
Carsten

Index: softmpeg.c
===================================================================
RCS file: /cvs/linuxtv/libsoftmpeg/src/softmpeg.c,v
retrieving revision 1.13
diff -u -3 -p -r1.13 softmpeg.c
--- softmpeg.c  19 Feb 2004 00:26:36 -0000      1.13
+++ softmpeg.c  20 Feb 2004 15:20:22 -0000
@@ -376,11 +376,14 @@ int softmpeg_decoder_process_pes_data(st
                        int ret2 = video_handle_pes_data(d->vdec, buf
+header_length, pes_packet_len-header_length, ptsdts_updated, pts);
                        /* fixme: delay handling for video necessary? */
                        delay = 0;
-               } else if (0xc0 == (ret & 0xf0)) {
+               } else if (0xc0 == (ret & 0xe0)) {
                        int ret2 = audio_handle_pes_data(d->adec, buf
+header_length, pes_packet_len-header_length, ptsdts_updated, pts);
                        delay = ret2;
                } else {
                        SOFTMPEG_WARN("unknown pes packet type\n");
+                       buf++;
+                       count--;
+                       continue;
                }
                if (delay > 0) {
                        softmpeg_sleep(delay);

----------------------------------------------------------------------------------




-- 
Info:  To unsubscribe send a mail to ecartis@linuxtv.org with 
"unsubscribe linuxtv-softmpeg" as subject.



Home | Main Index | Thread Index