diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-21 16:14:14 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-21 16:14:14 +0000 |
commit | ad9c24d1632d136b197c5e14c3a901f94f7f405c (patch) | |
tree | da1a7227eaa73f6c263abcb4a604da34c3a30f58 | |
parent | d88419bcd5055c79b1c251a937af217c04dc4b88 (diff) |
added demuxer_info
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3051 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/demuxer.c | 73 | ||||
-rw-r--r-- | libmpdemux/demuxer.h | 8 | ||||
-rw-r--r-- | mplayer.c | 3 |
3 files changed, 84 insertions, 0 deletions
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index a6ccb1b019..73c4d5b9a4 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -624,4 +624,77 @@ switch(demuxer->file_format){ return 1; } +int demux_info_add(demuxer_t *demuxer, char *opt, char *param) +{ + demuxer_info_t *info = &demuxer->info; + if (!strncmp(opt, "name")) + { + if (info->name) + { + mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->name already present\n!"); + return(0); + } + info->name = malloc(strlen(param)); + strcpy(info->name, param); + return(1); + } + + if (!strncmp(opt, "author")) + { + if (info->author) + { + mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->author already present\n!"); + return(0); + } + info->author = malloc(strlen(param)); + strcpy(info->author, param); + return(1); + } + + if (!strncmp(opt, "encoder")) + { + if (info->encoder) + { + mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->encoder already present\n!"); + return(0); + } + info->encoder = malloc(strlen(param)); + strcpy(info->encoder, param); + return(1); + } + + if (!strncmp(opt, "comments")) + { + if (info->comments) + { + mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->comments already present\n!"); + return(0); + } + info->comments = malloc(strlen(param)); + strcpy(info->comments, param); + return(1); + } + + mp_msg(MSGT_DEMUX, MSGL_WARN, "Unknown demuxer info->%s (=%s)!\n", + opt, param); + return(1); +} + +int demux_info_print(demuxer_t *demuxer) +{ + demuxer_info_t *info = &demuxer->info; + + if (info->name || info->author || info->encoder || info->comments) + { + mp_msg(MSGT_DEMUX, MSGL_INFO, "Clip info: \n"); + if (info->name) + mp_msg(MSGT_DEMUX, MSGL_INFO, " Name: %s\n", info->name); + if (info->author) + mp_msg(MSGT_DEMUX, MSGL_INFO, " Author: %s\n", info->author); + if (info->encoder) + mp_msg(MSGT_DEMUX, MSGL_INFO, " Encoder: %s\n", info->encoder); + if (info->comments) + mp_msg(MSGT_DEMUX, MSGL_INFO, " Comments: %s\n", info->comments); + } +} diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h index f07eb6602f..cd28db4df7 100644 --- a/libmpdemux/demuxer.h +++ b/libmpdemux/demuxer.h @@ -56,6 +56,13 @@ typedef struct { void* sh; } demux_stream_t; +typedef struct demuxer_info_st { + char *name; + char *author; + char *encoder; + char *comments; +} demuxer_info_t; + typedef struct demuxer_st { stream_t *stream; int synced; // stream synced (used by mpeg) @@ -76,6 +83,7 @@ typedef struct demuxer_st { char s_streams[32]; // dvd subtitles (flag) void* priv; // fileformat-dependent data + demuxer_info_t info; } demuxer_t; inline static demux_packet_t* new_demux_packet(int len){ @@ -875,6 +875,9 @@ if(!sh_video){ goto goto_next_file; // exit_player(MSGTR_Exit_error); } +/* display clip info */ +demux_info_print(demuxer); + //================== Init AUDIO (codec) ========================== current_module="init_audio_codec"; |