changeset 2788:4a909be26ea1

freeing up space and some debug
author alex
date Fri, 09 Nov 2001 22:17:35 +0000
parents 8dfe10c9f15d
children 7023bf2ff439
files libmpdemux/demux_viv.c
diffstat 1 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_viv.c	Fri Nov 09 22:04:09 2001 +0000
+++ b/libmpdemux/demux_viv.c	Fri Nov 09 22:17:35 2001 +0000
@@ -152,6 +152,13 @@
 	/* get next token */
 	token = strtok(NULL, (char *)&("\x0d\x0a"));
     }
+    
+    if (buf)
+	free(buf);
+    if (opt)
+	free(opt);
+    if (param)
+	free(param);
 }
 
 int vivo_check_file(demuxer_t* demuxer){
@@ -490,6 +497,10 @@
 		sh->bih->biSizeImage=sh->bih->biWidth*sh->bih->biHeight*3;
 		demuxer->video->sh=sh; sh->ds=demuxer->video;
 		demuxer->video->id=0;
+
+		printf("VIVO Video stream %d size: display: %dx%d, codec: %dx%d\n",
+		    demuxer->video->id, sh->disp_w, sh->disp_h, sh->bih->biWidth,
+		    sh->bih->biHeight);
 }
 
 if(demuxer->audio->id>=-1){
@@ -497,16 +508,19 @@
     mp_msg(MSGT_DEMUX,MSGL_ERR,"VIVO: " MSGTR_MissingAudioStream);
   } else
 {		sh_audio_t* sh=new_sh_audio(demuxer,1);
+
 		sh->format=0x111; // 0x112
 		// Emulate WAVEFORMATEX struct:
 		sh->wf=malloc(sizeof(WAVEFORMATEX));
 		memset(sh->wf,0,sizeof(WAVEFORMATEX));
 		sh->wf->nChannels=1;
 		sh->wf->wBitsPerSample=16;
+//		sh->wf->wBitsPerSample=8;
 		if (priv->samplerate)
 		    sh->wf->nSamplesPerSec=priv->samplerate;
 		else
 		    sh->wf->nSamplesPerSec=22050;
+//		    sh->wf->nSamplesPerSec=8000;
 		sh->wf->nAvgBytesPerSec=sh->wf->nChannels*sh->wf->wBitsPerSample*sh->wf->nSamplesPerSec/8;
 		demuxer->audio->sh=sh; sh->ds=demuxer->audio;
 		demuxer->audio->id=1;
@@ -515,3 +529,20 @@
 
 }
 
+void demux_close_vivo(demuxer_t *demuxer)
+{
+    vivo_priv_t* priv=demuxer->priv;
+    
+    if (priv->title)
+	free(priv->title);
+    if (priv->author)
+	free(priv->author);
+    if (priv->copyright)
+	free(priv->copyright);
+    if (priv->producer)
+	free(priv->producer);
+    if (priv)
+	free(priv);
+
+    return;
+}