[FFmpeg-soc] [soc]: r2313 - dvbmuxer/mpegenc.c
bcoudurier
subversion at mplayerhq.hu
Mon Jun 2 08:18:16 CEST 2008
Author: bcoudurier
Date: Mon Jun 2 08:18:16 2008
New Revision: 2313
Log:
sync with svn
Modified:
dvbmuxer/mpegenc.c
Modified: dvbmuxer/mpegenc.c
==============================================================================
--- dvbmuxer/mpegenc.c (original)
+++ dvbmuxer/mpegenc.c Mon Jun 2 08:18:16 2008
@@ -19,9 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/fifo.h"
+#include "libavcodec/bitstream.h"
#include "avformat.h"
-#include "bitstream.h"
-#include "fifo.h"
#include "mpeg.h"
#include "mpegpes.h"
@@ -811,8 +811,8 @@ static int flush_packet(AVFormatContext
}
/* output data */
- if(av_fifo_generic_read(&stream->fifo, payload_size - stuffing_size, &put_buffer, ctx->pb) < 0)
- return -1;
+ assert(payload_size - stuffing_size <= av_fifo_size(&stream->fifo));
+ av_fifo_generic_read(&stream->fifo, payload_size - stuffing_size, &put_buffer, ctx->pb);
stream->bytes_to_iframe -= payload_size - stuffing_size;
}else{
payload_size=
@@ -1040,7 +1040,7 @@ static int mpeg_mux_write_packet(AVForma
stream->predecode_packet= pkt_desc;
stream->next_packet= &pkt_desc->next;
- av_fifo_realloc(&stream->fifo, av_fifo_size(&stream->fifo) + size + 1);
+ av_fifo_realloc(&stream->fifo, av_fifo_size(&stream->fifo) + size);
if (s->is_dvd){
if (is_iframe && (s->packet_number == 0 || (pts - stream->vobu_start_pts >= 36000))) { // min VOBU length 0.4 seconds (mpucoder)
@@ -1050,7 +1050,7 @@ static int mpeg_mux_write_packet(AVForma
}
}
- av_fifo_write(&stream->fifo, buf, size);
+ av_fifo_generic_write(&stream->fifo, buf, size, NULL);
for(;;){
int ret= output_packet(ctx, 0);
More information about the FFmpeg-soc
mailing list