changeset 11222:b82e3ecb11e0

some updates in muxer api
author alex
date Wed, 22 Oct 2003 17:04:39 +0000
parents 5c6e899ee6f3
children b677b25a898d
files libmpdemux/muxer.h mencoder.c mp_msg.h
diffstat 3 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/muxer.h	Wed Oct 22 16:45:33 2003 +0000
+++ b/libmpdemux/muxer.h	Wed Oct 22 17:04:39 2003 +0000
@@ -36,6 +36,7 @@
   size_t ipb[3]; // sizes of I/P/B frames
   // muxer of that stream
   struct muxer_t *muxer;
+  void *priv; // private stream specific data stored by the muxer
 } muxer_stream_t;
 
 typedef struct {
--- a/mencoder.c	Wed Oct 22 16:45:33 2003 +0000
+++ b/mencoder.c	Wed Oct 22 17:04:39 2003 +0000
@@ -232,7 +232,7 @@
 #include "vobsub.h"
 
 /* FIXME */
-void mencoder_exit(int level, char *how)
+static void mencoder_exit(int level, char *how)
 {
     if (how)
 	printf("Exiting... (%s)\n", how);
@@ -385,7 +385,7 @@
   if(!parse_codec_cfg(MPLAYER_CONFDIR "/codecs.conf")){
     if(!parse_codec_cfg(NULL)){
       mp_msg(MSGT_MENCODER,MSGL_HINT,MSGTR_CopyCodecsConf);
-      exit(0);
+      mencoder_exit(1,NULL);
     }
     mp_msg(MSGT_MENCODER,MSGL_INFO,MSGTR_BuiltinCodecsConf);
   }
@@ -804,7 +804,7 @@
 } // if(sh_audio)
 
 printf(MSGTR_WritingAVIHeader);
-muxer_write_header(muxer);
+if (muxer->cont_write_header) muxer_write_header(muxer);
 
 decoded_frameno=0;
 
@@ -1263,11 +1263,11 @@
 #endif
 
 printf(MSGTR_WritingAVIIndex);
-muxer_write_index(muxer);
+if (muxer->cont_write_index) muxer_write_index(muxer);
 muxer_f_size=ftello(muxer_f);
 printf(MSGTR_FixupAVIHeader);
 fseek(muxer_f,0,SEEK_SET);
-muxer_write_header(muxer); // update header
+if (muxer->cont_write_header) muxer_write_header(muxer); // update header
 if(ferror(muxer_f) || fclose(muxer_f) != 0) {
     mp_msg(MSGT_MENCODER,MSGL_FATAL,MSGTR_ErrorWritingFile, out_filename);
     mencoder_exit(1, NULL);
--- a/mp_msg.h	Wed Oct 22 16:45:33 2003 +0000
+++ b/mp_msg.h	Wed Oct 22 17:04:39 2003 +0000
@@ -85,6 +85,8 @@
 
 #define MSGT_NETST 38 // Netstream
 
+#define MSGT_MUXER 39 // muxer layer
+
 #define MSGT_MAX 64
 
 void mp_msg_init();