From 331982b99ce3b50b95ac340eb17c6116913480f3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 15 Apr 2013 21:25:21 +0200 Subject: sub, demux: identify subtitle types with the codec name Get rid of the 1-char subtitle type field. Use sh_stream->codec instead just like audio and video do. Use codec names as defined by libavcodec for simplicity, even if they're somewhat verbose and annoying. Note that ffmpeg might switch to "ass" as codec name for ASS, so we don't bother with the current silly "ssa" name. --- demux/demux_lavf.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'demux/demux_lavf.c') diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 498f99e014..968e9e60c8 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -387,32 +387,11 @@ static void handle_stream(demuxer_t *demuxer, int i) } case AVMEDIA_TYPE_SUBTITLE: { sh_sub_t *sh_sub; - char type; - if (codec->codec_id == AV_CODEC_ID_TEXT || - codec->codec_id == AV_CODEC_ID_SUBRIP) - type = 't'; - else if (codec->codec_id == AV_CODEC_ID_MOV_TEXT) - type = 'm'; - else if (codec->codec_id == AV_CODEC_ID_SSA) - type = 'a'; - else if (codec->codec_id == AV_CODEC_ID_DVD_SUBTITLE) - type = 'v'; - else if (codec->codec_id == AV_CODEC_ID_XSUB) - type = 'x'; - else if (codec->codec_id == AV_CODEC_ID_DVB_SUBTITLE) - type = 'b'; - else if (codec->codec_id == AV_CODEC_ID_DVB_TELETEXT) - type = 'd'; - else if (codec->codec_id == AV_CODEC_ID_HDMV_PGS_SUBTITLE) - type = 'p'; - else - break; sh = new_sh_stream(demuxer, STREAM_SUB); if (!sh) break; sh_sub = sh->sub; - sh_sub->type = type; if (codec->extradata_size) { sh_sub->extradata = malloc(codec->extradata_size); memcpy(sh_sub->extradata, codec->extradata, codec->extradata_size); -- cgit v1.2.3