From e928649b0bf6c8c7b87eb09d5e393a70387b10e9 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 29 May 2004 02:06:32 +0000 Subject: pass AVPacket into av_write_frame() fixes the random dts/pts during encoding asf preroll fix no more initial zero frames for b frame encoding mpeg-es dts during demuxing fixed .ffm timestamp scale fixed, ffm is still broken though Originally committed as revision 3168 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/rtp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libavformat/rtp.c') diff --git a/libavformat/rtp.c b/libavformat/rtp.c index 5d4884d8f7..31e4a21dc1 100644 --- a/libavformat/rtp.c +++ b/libavformat/rtp.c @@ -669,16 +669,17 @@ static void rtp_send_mpegts_raw(AVFormatContext *s1, } /* write an RTP packet. 'buf1' must contain a single specific frame. */ -static int rtp_write_packet(AVFormatContext *s1, int stream_index, - const uint8_t *buf1, int size, int64_t pts) +static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt) { RTPDemuxContext *s = s1->priv_data; AVStream *st = s1->streams[0]; int rtcp_bytes; int64_t ntp_time; + int size= pkt->size; + uint8_t *buf1= pkt->data; #ifdef DEBUG - printf("%d: write len=%d\n", stream_index, size); + printf("%d: write len=%d\n", pkt->stream_index, size); #endif /* XXX: mpeg pts hardcoded. RTCP send every 0.5 seconds */ @@ -687,7 +688,7 @@ static int rtp_write_packet(AVFormatContext *s1, int stream_index, if (s->first_packet || rtcp_bytes >= 28) { /* compute NTP time */ /* XXX: 90 kHz timestamp hardcoded */ - ntp_time = (pts << 28) / 5625; + ntp_time = (pkt->pts << 28) / 5625; rtcp_send_sr(s1, ntp_time); s->last_octet_count = s->octet_count; s->first_packet = 0; -- cgit v1.2.3