[MPlayer-cvslog] r32006 - in trunk/libmpdemux: demux_lavf.c demuxer.c stheader.h
reimar
subversion at mplayerhq.hu
Sat Aug 21 18:04:18 CEST 2010
Author: reimar
Date: Sat Aug 21 18:04:18 2010
New Revision: 32006
Log:
Print subtitle type also for internally-supported types with a libavcodec decoder.
Modified:
trunk/libmpdemux/demux_lavf.c
trunk/libmpdemux/demuxer.c
trunk/libmpdemux/stheader.h
Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c Sat Aug 21 13:54:04 2010 (r32005)
+++ trunk/libmpdemux/demux_lavf.c Sat Aug 21 18:04:18 2010 (r32006)
@@ -461,7 +461,10 @@ static void handle_stream(demuxer_t *dem
}
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)
Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c Sat Aug 21 13:54:04 2010 (r32005)
+++ trunk/libmpdemux/demuxer.c Sat Aug 21 18:04:18 2010 (r32006)
@@ -254,6 +254,21 @@ demuxer_t *new_demuxer(stream_t *stream,
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, const char *lang)
{
if (id > MAX_S_STREAMS - 1 || id < 0) {
Modified: trunk/libmpdemux/stheader.h
==============================================================================
--- trunk/libmpdemux/stheader.h Sat Aug 21 13:54:04 2010 (r32005)
+++ trunk/libmpdemux/stheader.h Sat Aug 21 18:04:18 2010 (r32006)
@@ -140,6 +140,8 @@ sh_sub_t *new_sh_sub_sid(demuxer_t *demu
void free_sh_audio(demuxer_t *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);
More information about the MPlayer-cvslog
mailing list