summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demuxer.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-07-29 21:04:57 +0200
committerwm4 <wm4@nowhere>2012-07-30 01:42:55 +0200
commit521a5980681885a8bc41a04c4c353a64c2f47992 (patch)
tree604b83d7ec4aff0f43015e2b18b6df0605697e2c /libmpdemux/demuxer.c
parent3daf32adfd69e940585737631f1fb95264938268 (diff)
downloadmpv-521a5980681885a8bc41a04c4c353a64c2f47992.tar.bz2
mpv-521a5980681885a8bc41a04c4c353a64c2f47992.tar.xz
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.
Diffstat (limited to 'libmpdemux/demuxer.c')
-rw-r--r--libmpdemux/demuxer.c12
1 files changed, 12 insertions, 0 deletions
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;