[Ffmpeg-devel] [patch] dvbsub: two small bugs

Josef Zlomek josef.zlomek
Wed Mar 22 20:27:14 CET 2006


Hello,

I have found and fixed two bugs in DVB subtitle encoder codec.

According to ETSI EN 300 743 (DVB subtitling systems),
the DVB subtitle should start with data_identifier, which
is 0x20.

The second thing is that the object_version are the higher 4 bits.
The second hunk shifts the object_version by 4 bits to left.

The patch is attached.

Regards,

Josef
-------------- next part --------------
Index: dvbsub.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/dvbsub.c,v
retrieving revision 1.6
diff -u -p -r1.6 dvbsub.c
--- dvbsub.c	12 Jan 2006 22:43:15 -0000	1.6
+++ dvbsub.c	22 Mar 2006 19:15:55 -0000
@@ -229,6 +229,7 @@ static int encode_dvb_subtitles(DVBSubti
     if (h->num_rects == 0 || h->rects == NULL)
         return -1;
 
+    *q++ = 0x20; /* data_identifier */
     *q++ = 0x00; /* subtitle_stream_id */
 
     /* page composition segment */
@@ -244,7 +245,7 @@ static int encode_dvb_subtitles(DVBSubti
     else
         page_state = 2; /* mode change */
     /* page_version = 0 + page_state */
-    *q++ = s->object_version | (page_state << 2) | 3;
+    *q++ = (s->object_version << 4) | (page_state << 2) | 3;
 
     for (region_id = 0; region_id < h->num_rects; region_id++) {
         *q++ = region_id;



More information about the ffmpeg-devel mailing list