[FFmpeg-soc] [soc]: r2018 - dvbmuxer/mpegenc.c

bcoudurier subversion at mplayerhq.hu
Wed Mar 12 12:15:24 CET 2008


Author: bcoudurier
Date: Wed Mar 12 12:15:24 2008
New Revision: 2018

Log:
use ff_pes_remove_decoded_packets

Modified:
   dvbmuxer/mpegenc.c

Modified: dvbmuxer/mpegenc.c
==============================================================================
--- dvbmuxer/mpegenc.c	(original)
+++ dvbmuxer/mpegenc.c	Wed Mar 12 12:15:24 2008
@@ -949,34 +949,6 @@ static int64_t get_vcd_scr(AVFormatConte
 }
 #endif
 
-static int remove_decoded_packets(AVFormatContext *ctx, int64_t scr){
-//    MpegMuxContext *s = ctx->priv_data;
-    int i;
-
-    for(i=0; i<ctx->nb_streams; i++){
-        AVStream *st = ctx->streams[i];
-        PESStream *stream = st->priv_data;
-        PacketDesc *pkt_desc;
-
-        while((pkt_desc= stream->predecode_packet)
-              && scr > pkt_desc->dts){ //FIXME > vs >=
-            if(stream->buffer_index < pkt_desc->size ||
-               stream->predecode_packet == stream->premux_packet){
-                av_log(ctx, AV_LOG_ERROR,
-                       "buffer underflow i=%d bufi=%d size=%d\n",
-                       i, stream->buffer_index, pkt_desc->size);
-                break;
-            }
-            stream->buffer_index -= pkt_desc->size;
-
-            stream->predecode_packet= pkt_desc->next;
-            av_freep(&pkt_desc);
-        }
-    }
-
-    return 0;
-}
-
 static int output_packet(AVFormatContext *ctx, int flush){
     MpegMuxContext *s = ctx->priv_data;
     AVStream *st;
@@ -1043,7 +1015,7 @@ retry:
             ignore_constraints= 1;
         }
         scr= FFMAX(best_dts+1, scr);
-        if(remove_decoded_packets(ctx, scr) < 0)
+        if(ff_pes_remove_decoded_packets(ctx, scr) < 0)
             return -1;
         goto retry;
     }
@@ -1094,7 +1066,7 @@ retry:
     if(es_size)
         stream->premux_packet->unwritten_size -= es_size;
 
-    if(remove_decoded_packets(ctx, s->last_scr) < 0)
+    if(ff_pes_remove_decoded_packets(ctx, s->last_scr) < 0)
         return -1;
 
     return 1;



More information about the FFmpeg-soc mailing list