mirror of https://git.ffmpeg.org/ffmpeg.git
export raw SSA tracks with their own codec ID (patch by Evgeniy Stepanov)
Originally committed as revision 11352 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
243cc4c34a
commit
f9a9b3509c
|
@ -282,6 +282,7 @@ enum CodecID {
|
||||||
CODEC_ID_DVB_SUBTITLE,
|
CODEC_ID_DVB_SUBTITLE,
|
||||||
CODEC_ID_TEXT, ///< raw UTF-8 text
|
CODEC_ID_TEXT, ///< raw UTF-8 text
|
||||||
CODEC_ID_XSUB,
|
CODEC_ID_XSUB,
|
||||||
|
CODEC_ID_SSA,
|
||||||
|
|
||||||
CODEC_ID_MPEG2TS= 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
|
CODEC_ID_MPEG2TS= 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
|
||||||
* stream (only used by libavformat) */
|
* stream (only used by libavformat) */
|
||||||
|
|
|
@ -62,10 +62,10 @@ const CodecTags ff_mkv_codec_tags[]={
|
||||||
|
|
||||||
{"S_TEXT/UTF8" , CODEC_ID_TEXT},
|
{"S_TEXT/UTF8" , CODEC_ID_TEXT},
|
||||||
{"S_TEXT/ASCII" , CODEC_ID_TEXT},
|
{"S_TEXT/ASCII" , CODEC_ID_TEXT},
|
||||||
{"S_TEXT/ASS" , CODEC_ID_TEXT},
|
{"S_TEXT/ASS" , CODEC_ID_SSA},
|
||||||
{"S_TEXT/SSA" , CODEC_ID_TEXT},
|
{"S_TEXT/SSA" , CODEC_ID_SSA},
|
||||||
{"S_ASS" , CODEC_ID_TEXT},
|
{"S_ASS" , CODEC_ID_SSA},
|
||||||
{"S_SSA" , CODEC_ID_TEXT},
|
{"S_SSA" , CODEC_ID_SSA},
|
||||||
{"S_VOBSUB" , CODEC_ID_DVD_SUBTITLE},
|
{"S_VOBSUB" , CODEC_ID_DVD_SUBTITLE},
|
||||||
|
|
||||||
{NULL , CODEC_ID_NONE}
|
{NULL , CODEC_ID_NONE}
|
||||||
|
|
|
@ -94,8 +94,6 @@ typedef struct MatroskaAudioTrack {
|
||||||
|
|
||||||
typedef struct MatroskaSubtitleTrack {
|
typedef struct MatroskaSubtitleTrack {
|
||||||
MatroskaTrack track;
|
MatroskaTrack track;
|
||||||
|
|
||||||
int ass;
|
|
||||||
//..
|
//..
|
||||||
} MatroskaSubtitleTrack;
|
} MatroskaSubtitleTrack;
|
||||||
|
|
||||||
|
@ -2160,15 +2158,6 @@ matroska_read_header (AVFormatContext *s,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (codec_id == CODEC_ID_TEXT) {
|
|
||||||
MatroskaSubtitleTrack *subtrack=(MatroskaSubtitleTrack *)track;
|
|
||||||
if (!strcmp(track->codec_id, "S_TEXT/ASS") ||
|
|
||||||
!strcmp(track->codec_id, "S_TEXT/SSA") ||
|
|
||||||
!strcmp(track->codec_id, "S_ASS") ||
|
|
||||||
!strcmp(track->codec_id, "S_SSA"))
|
|
||||||
subtrack->ass = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (codec_id == CODEC_ID_NONE) {
|
if (codec_id == CODEC_ID_NONE) {
|
||||||
av_log(matroska->ctx, AV_LOG_INFO,
|
av_log(matroska->ctx, AV_LOG_INFO,
|
||||||
"Unknown/unsupported CodecID %s.\n",
|
"Unknown/unsupported CodecID %s.\n",
|
||||||
|
@ -2438,14 +2427,6 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
|
||||||
} else {
|
} else {
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
|
||||||
if (st->codec->codec_id == CODEC_ID_TEXT
|
|
||||||
&& ((MatroskaSubtitleTrack *)(matroska->tracks[track]))->ass) {
|
|
||||||
int i;
|
|
||||||
for (i=0; i<8 && data[offset]; offset++)
|
|
||||||
if (data[offset] == ',')
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
pkt = av_mallocz(sizeof(AVPacket));
|
pkt = av_mallocz(sizeof(AVPacket));
|
||||||
/* XXX: prevent data copy... */
|
/* XXX: prevent data copy... */
|
||||||
if (av_new_packet(pkt, lace_size[n]-offset) < 0) {
|
if (av_new_packet(pkt, lace_size[n]-offset) < 0) {
|
||||||
|
|
Loading…
Reference in New Issue