mpegts muxer, DVB subtitles encoder: common DVB subtitles payload

Improved DVB subtitles encoder to generate AVPacket.data in the same
format as generates MPEGTS demuxer + DVB subtitles parser. So now single
format of DVB subtitles data is used across all the components of FFmpeg:
only subtitles payload WITHOUT 0x20 0x00 bytes at the beginning and 0xFF
trailing byte.

Improved MPEGTS muxer to support format of DVB subtitles in
AVPacket.data described above: while muxing we add two bytes 0x20 0x00 to
the beginning of and 0xFF to the end of DVB subtitles payload.

The patch fixes DVB subtitle copy problems: tickets #2989 fully and #2024
partly.

Signed-off-by: Clément Bœsch <u@pkh.me>
This commit is contained in:
Serhii Marchuk
2014-01-11 22:54:29 +02:00
committed by Clément Bœsch
parent d497141b85
commit c917cde9cc
4 changed files with 27 additions and 15 deletions

View File

@@ -261,8 +261,6 @@ static int encode_dvb_subtitles(DVBSubtitleContext *s,
if (h->num_rects && h->rects == NULL)
return -1;
*q++ = 0x00; /* subtitle_stream_id */
/* page composition segment */
*q++ = 0x0f; /* sync_byte */
@@ -437,8 +435,6 @@ static int encode_dvb_subtitles(DVBSubtitleContext *s,
bytestream_put_be16(&pseg_len, q - pseg_len - 2);
*q++ = 0xff; /* end of PES data */
s->object_version = (s->object_version + 1) & 0xf;
return q - outbuf;
}