[Mplayer-cvslog] CVS: main/libmpdemux demuxer.c,1.45,1.46 demuxer.h,1.19,1.20

Alex Beregszaszi alex at mplayer.dev.hu
Wed Nov 21 17:14:16 CET 2001


Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv3987

Modified Files:
	demuxer.c demuxer.h 
Log Message:
added demuxer_info

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- demuxer.c	16 Nov 2001 21:30:10 -0000	1.45
+++ demuxer.c	21 Nov 2001 16:14:14 -0000	1.46
@@ -624,4 +624,77 @@
 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);
+    }
+}

Index: demuxer.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- demuxer.h	9 Nov 2001 23:46:06 -0000	1.19
+++ demuxer.h	21 Nov 2001 16:14:14 -0000	1.20
@@ -56,6 +56,13 @@
   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 @@
   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){




More information about the MPlayer-cvslog mailing list