diff options
author | wm4 <wm4@nowhere> | 2013-04-15 21:25:21 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-20 23:28:27 +0200 |
commit | 331982b99ce3b50b95ac340eb17c6116913480f3 (patch) | |
tree | b0e0c14521f509a883c0420d9e6277c0329eb773 /demux/demux_lavf.c | |
parent | 5ac50f88c90167e9ade0c998ac62e935e259acee (diff) | |
download | mpv-331982b99ce3b50b95ac340eb17c6116913480f3.tar.bz2 mpv-331982b99ce3b50b95ac340eb17c6116913480f3.tar.xz |
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.
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r-- | demux/demux_lavf.c | 21 |
1 files changed, 0 insertions, 21 deletions
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); |