[Mplayer-cvslog] CVS: main demuxer.c,1.26,1.27 demuxer.h,1.14,1.15

Arpi of Ize arpi at mplayer.dev.hu
Thu Aug 23 01:55:00 CEST 2001


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

Modified Files:
	demuxer.c demuxer.h 
Log Message:
free demux/ds/sh

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/demuxer.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- demuxer.c	22 Aug 2001 19:40:46 -0000	1.26
+++ demuxer.c	22 Aug 2001 23:54:57 -0000	1.27
@@ -21,6 +21,11 @@
 #include "codec-cfg.h"
 #include "stheader.h"
 
+void free_demuxer_stream(demux_stream_t *ds){
+    ds_free_packs(ds);
+    free(ds);
+}
+
 demux_stream_t* new_demuxer_stream(struct demuxer_st *demuxer,int id){
   demux_stream_t* ds=malloc(sizeof(demux_stream_t));
   ds->buffer_pos=ds->buffer_size=0;
@@ -74,6 +79,13 @@
     return demuxer->a_streams[id];
 }
 
+void free_sh_audio(sh_audio_t* sh){
+    if(sh->a_in_buffer) free(sh->a_in_buffer);
+    if(sh->a_buffer) free(sh->a_buffer);
+    if(sh->wf) free(sh->wf);
+    free(sh);
+}
+
 sh_video_t* new_sh_video(demuxer_t *demuxer,int id){
     if(demuxer->v_streams[id]){
         mp_msg(MSGT_DEMUXER,MSGL_WARN,MSGTR_VideoStreamRedefined,id);
@@ -85,6 +97,27 @@
     return demuxer->v_streams[id];
 }
 
+void free_sh_video(sh_video_t* sh){
+//    if(sh->our_out_buffer) free(sh->our_out_buffer);
+//    if(sh->bih) free(sh->bih);
+    free(sh);
+}
+
+void free_demuxer(demuxer_t *demuxer){
+    int i;
+    // free streams:
+    for(i=0;i<256;i++){
+	if(demuxer->a_streams[i]) free_sh_audio(demuxer->a_streams[i]);
+	if(demuxer->v_streams[i]) free_sh_video(demuxer->v_streams[i]);
+    }
+    //if(sh_audio) free_sh_audio(sh_audio);
+    //if(sh_video) free_sh_video(sh_video);
+    // free demuxers:
+    free_demuxer_stream(demuxer->audio);
+    free_demuxer_stream(demuxer->video);
+    free(demuxer);
+}
+
 
 void ds_add_packet(demux_stream_t *ds,demux_packet_t* dp){
 //    demux_packet_t* dp=new_demux_packet(len);
@@ -480,8 +513,6 @@
 
 return demuxer;
 }
-
-
 
 int demux_seek_avi(demuxer_t *demuxer,float rel_seek_secs,int flags);
 int demux_seek_asf(demuxer_t *demuxer,float rel_seek_secs,int flags);

Index: demuxer.h
===================================================================
RCS file: /cvsroot/mplayer/main/demuxer.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- demuxer.h	22 Aug 2001 16:42:37 -0000	1.14
+++ demuxer.h	22 Aug 2001 23:54:57 -0000	1.15
@@ -94,6 +94,8 @@
 
 demux_stream_t* new_demuxer_stream(struct demuxer_st *demuxer,int id);
 demuxer_t* new_demuxer(stream_t *stream,int type,int a_id,int v_id,int s_id);
+void free_demuxer_stream(demux_stream_t *ds);
+void free_demuxer(demuxer_t *demuxer);
 
 void ds_add_packet(demux_stream_t *ds,demux_packet_t* dp);
 void ds_read_packet(demux_stream_t *ds,stream_t *stream,int len,float pts,off_t pos,int flags);
@@ -148,5 +150,6 @@
 
 demuxer_t* demux_open(stream_t *stream,int file_format,int aid,int vid,int sid);
 int demux_seek(demuxer_t *demuxer,float rel_seek_secs,int flags);
+
 
 




More information about the MPlayer-cvslog mailing list