1
mirror of https://github.com/mpv-player/mpv synced 2024-10-22 08:51:57 +02:00

demux_lavf: print subtitle type in more cases

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32006 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-08-21 16:04:18 +00:00 committed by Uoti Urpala
parent ef7ae1b8e8
commit 0e82595632
3 changed files with 21 additions and 1 deletions

View File

@ -469,7 +469,10 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) {
}
if (stream_type) {
AVCodec *avc = avcodec_find_decoder(codec->codec_id);
mp_msg(MSGT_DEMUX, MSGL_INFO, "[lavf] stream %d: %s (%s), -%cid %d", i, stream_type, avc ? avc->name : "unknown", *stream_type, stream_id);
const char *codec_name = avc ? avc->name : "unknown";
if (!avc && *stream_type == 's' && demuxer->s_streams[stream_id])
codec_name = sh_sub_type2str(((sh_sub_t *)demuxer->s_streams[stream_id])->type);
mp_msg(MSGT_DEMUX, MSGL_INFO, "[lavf] stream %d: %s (%s), -%cid %d", i, stream_type, codec_name, *stream_type, stream_id);
if (lang && lang->value && *stream_type != 'v')
mp_msg(MSGT_DEMUX, MSGL_INFO, ", -%clang %s", *stream_type, lang->value);
if (title && title->value)

View File

@ -247,6 +247,21 @@ demuxer_t *new_demuxer(struct MPOpts *opts, stream_t *stream, int type,
return d;
}
const char *sh_sub_type2str(int type)
{
switch (type) {
case 't': return "text";
case 'm': return "movtext";
case 'a': return "ass";
case 'v': return "vobsub";
case 'x': return "xsub";
case 'b': return "dvb";
case 'd': return "dvb-teletext";
case 'p': return "hdmv pgs";
}
return "unknown";
}
sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid)
{
if (id > MAX_S_STREAMS - 1 || id < 0) {

View File

@ -151,6 +151,8 @@ struct sh_sub *new_sh_sub_sid_lang(struct demuxer *demuxer, int id, int sid,
void free_sh_audio(struct demuxer *demuxer, int id);
void free_sh_video(sh_video_t *sh);
const char *sh_sub_type2str(int type);
// video.c:
int video_read_properties(sh_video_t *sh_video);
int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps);