[MPlayer-cvslog] CVS: main/libmpdemux demuxer.c, 1.220, 1.221 demuxer.h, 1.92, 1.93 stheader.h, 1.42, 1.43

Roberto Togni CVS syncmail at mplayerhq.hu
Mon Apr 24 12:58:42 CEST 2006


CVS change done by Roberto Togni CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv7324/libmpdemux

Modified Files:
	demuxer.c demuxer.h stheader.h 
Log Message:
4 - Implement a better way to calculate current audio pts and use it for
audio decoded with ad_libvorbis, ad_ffmpeg and ad_faad.

Patch by Uoti Urpala


Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.220
retrieving revision 1.221
diff -u -r1.220 -r1.221
--- demuxer.c	24 Apr 2006 07:20:34 -0000	1.220
+++ demuxer.c	24 Apr 2006 10:58:40 -0000	1.221
@@ -224,6 +224,7 @@
         sh->samplesize=2;
         sh->sample_format=AF_FORMAT_S16_NE;
         sh->audio_out_minsize=8192;/* default size, maybe not enough for Win32/ACM*/
+        sh->pts=MP_NOPTS_VALUE;
         if (!demux_aid_vid_mismatch)
           mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_ID=%d\n", id);
     }
@@ -502,6 +503,26 @@
     }
 }
 
+int ds_get_packet_pts(demux_stream_t *ds,unsigned char **start, double *pts)
+{
+    int len;
+    *pts = MP_NOPTS_VALUE;
+    if(ds->buffer_pos>=ds->buffer_size){
+	if (!ds_fill_buffer(ds)) {
+            // EOF
+            *start = NULL;
+            return -1;
+	}
+	// Should use MP_NOPTS_VALUE for "unknown pts" in the packets too
+	if (ds->current->pts)
+	    *pts = ds->current->pts;
+    }
+    len=ds->buffer_size-ds->buffer_pos;
+    *start = &ds->buffer[ds->buffer_pos];
+    ds->buffer_pos+=len;
+    return len;
+}
+
 int ds_get_packet_sub(demux_stream_t *ds,unsigned char **start){
     while(1){
         int len;

Index: demuxer.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.h,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- demuxer.h	24 Apr 2006 10:36:29 -0000	1.92
+++ demuxer.h	24 Apr 2006 10:58:40 -0000	1.93
@@ -284,6 +284,7 @@
 
 void ds_free_packs(demux_stream_t *ds);
 int ds_get_packet(demux_stream_t *ds,unsigned char **start);
+int ds_get_packet_pts(demux_stream_t *ds, unsigned char **start, double *pts);
 int ds_get_packet_sub(demux_stream_t *ds,unsigned char **start);
 float ds_get_next_pts(demux_stream_t *ds);
 

Index: stheader.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stheader.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- stheader.h	18 Feb 2006 09:26:39 -0000	1.42
+++ stheader.h	24 Apr 2006 10:58:40 -0000	1.43
@@ -47,6 +47,8 @@
   void* context; // codec-specific stuff (usually HANDLE or struct pointer)
   unsigned char* codecdata; // extra header data passed from demuxer to codec
   int codecdata_len;
+  double pts;  // last known pts value in output from decoder
+  int pts_bytes; // bytes output by decoder after last known pts
 } sh_audio_t;
 
 typedef struct {




More information about the MPlayer-cvslog mailing list