From 521a5980681885a8bc41a04c4c353a64c2f47992 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 29 Jul 2012 21:04:57 +0200 Subject: mplayer: let frontend print stream info, instead of demuxers When playing a file, users (i.e. me) expect mplayer to print a list of video/audio/subtitle streams. Currently, this is done in each demuxer separately. This also means the output is formatted differently depending which demuxer is active. Add code to print an uniformly formatted streams list in the player front end. Extend the streams headers to export additional information about the streams. Change the lavf and mkv demuxers to follow this new scheme, and raise the log level for the "old" printing functions. The intention is to make every demuxer behave like this eventually. The stream list output attempts to provide codec information. It's a bit hacky and doesn't always provide useful output, and I'm not sure how to do it better. --- libmpdemux/demuxer.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libmpdemux/demuxer.c') diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index 453de0b91a..85c98306f1 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -354,6 +354,10 @@ sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid) else { struct sh_sub *sh = talloc_zero(demuxer, struct sh_sub); demuxer->s_streams[id] = sh; + sh->stream_type = STREAM_SUBTITLE; + sh->demuxer_id = demuxer->new_stream_id++; + sh->id = sid; + sh->index = id; sh->sid = sid; sh->opts = demuxer->opts; mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SUBTITLE_ID=%d\n", sid); @@ -394,6 +398,10 @@ sh_audio_t *new_sh_audio_aid(demuxer_t *demuxer, int id, int aid) mp_tmsg(MSGT_DEMUXER, MSGL_V, "==> Found audio stream: %d\n", id); struct sh_audio *sh = talloc_zero(demuxer, struct sh_audio); demuxer->a_streams[id] = sh; + sh->stream_type = STREAM_AUDIO; + sh->demuxer_id = demuxer->new_stream_id++; + sh->id = aid; + sh->index = id; sh->aid = aid; sh->ds = demuxer->audio; // set some defaults @@ -430,6 +438,10 @@ sh_video_t *new_sh_video_vid(demuxer_t *demuxer, int id, int vid) mp_tmsg(MSGT_DEMUXER, MSGL_V, "==> Found video stream: %d\n", id); struct sh_video *sh = talloc_zero(demuxer, struct sh_video); demuxer->v_streams[id] = sh; + sh->stream_type = STREAM_VIDEO; + sh->demuxer_id = demuxer->new_stream_id++; + sh->id = vid; + sh->index = id; sh->vid = vid; sh->ds = demuxer->video; sh->opts = demuxer->opts; -- cgit v1.2.3