diff options
author | Juanjo <pulento@users.sourceforge.net> | 2002-04-07 21:44:29 +0000 |
---|---|---|
committer | Juanjo <pulento@users.sourceforge.net> | 2002-04-07 21:44:29 +0000 |
commit | 10bb7023a224adbcd2b97d5115db57bf13094906 (patch) | |
tree | 85921bed3e9756d92ba95b8bd3f74e9cea9d0866 /libav/mpeg.c | |
parent | 3bf43d42eda38abd5b75d004e1431d71aacfbe48 (diff) | |
download | ffmpeg-10bb7023a224adbcd2b97d5115db57bf13094906.tar.gz |
- Added force_pts to av_write_packet() to be able to force PTS, this helps
(and fix) stream copying. By now force_pts it's just honoured by the MPEG
muxer. ASF could honour this also, but it should be fixed to use Tickers
first.
- MPEG audio decoder exports it's frame size in bytes.
- Hope this fix the floating point exception found in ffserver.
Originally committed as revision 382 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libav/mpeg.c')
-rw-r--r-- | libav/mpeg.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libav/mpeg.c b/libav/mpeg.c index 2871278778..637972471c 100644 --- a/libav/mpeg.c +++ b/libav/mpeg.c @@ -321,18 +321,21 @@ static void flush_packet(AVFormatContext *ctx, int stream_index) stream->start_pts = -1; } -static int mpeg_mux_write_packet(AVFormatContext *ctx, - int stream_index, UINT8 *buf, int size) +static int mpeg_mux_write_packet(AVFormatContext *ctx, int stream_index, + UINT8 *buf, int size, int force_pts) { MpegMuxContext *s = ctx->priv_data; AVStream *st = ctx->streams[stream_index]; StreamInfo *stream = st->priv_data; int len; - + while (size > 0) { /* set pts */ - if (stream->start_pts == -1) + if (stream->start_pts == -1) { + if (force_pts) + stream->pts = force_pts; stream->start_pts = stream->pts; + } len = s->packet_data_max_size - stream->buffer_ptr; if (len > size) len = size; @@ -714,6 +717,8 @@ static int mpeg_mux_read_packet(AVFormatContext *s, goto redo; found: av_new_packet(pkt, len); + //printf("\nRead Packet ID: %x PTS: %f Size: %d", startcode, + // (float)pts/90000, len); get_buffer(&s->pb, pkt->data, pkt->size); pkt->pts = pts; pkt->stream_index = i; |