[FFmpeg-cvslog] r17737 - in branches/0.5: ffmpeg.c libavformat/flvdec.c libavformat/utils.c
bcoudurier
subversion
Mon Mar 2 21:32:25 CET 2009
Author: bcoudurier
Date: Mon Mar 2 21:32:24 2009
New Revision: 17737
Log:
revert r16717, r16718, r16719, EAGAIN handling, this causes FFserver to hang
Modified:
branches/0.5/ffmpeg.c
branches/0.5/libavformat/flvdec.c
branches/0.5/libavformat/utils.c
Modified: branches/0.5/ffmpeg.c
==============================================================================
--- branches/0.5/ffmpeg.c Mon Mar 2 20:42:31 2009 (r17736)
+++ branches/0.5/ffmpeg.c Mon Mar 2 21:32:24 2009 (r17737)
@@ -2102,10 +2102,7 @@ static int av_encode(AVFormatContext **o
/* read a frame from it and output it in the fifo */
is = input_files[file_index];
- ret= av_read_frame(is, &pkt);
- if(ret == AVERROR(EAGAIN) && strcmp(is->iformat->name, "ffm"))
- continue;
- if (ret < 0) {
+ if (av_read_frame(is, &pkt) < 0) {
file_table[file_index].eof_reached = 1;
if (opt_shortest)
break;
Modified: branches/0.5/libavformat/flvdec.c
==============================================================================
--- branches/0.5/libavformat/flvdec.c Mon Mar 2 20:42:31 2009 (r17736)
+++ branches/0.5/libavformat/flvdec.c Mon Mar 2 21:32:24 2009 (r17737)
@@ -313,6 +313,7 @@ static int flv_read_packet(AVFormatConte
int64_t dts, pts = AV_NOPTS_VALUE;
AVStream *st = NULL;
+ retry:
for(;;){
pos = url_ftell(s->pb);
url_fskip(s->pb, 4); /* size of previous packet */
@@ -348,7 +349,7 @@ static int flv_read_packet(AVFormatConte
av_log(s, AV_LOG_ERROR, "skipping flv packet: type %d, size %d, flags %d\n", type, size, flags);
skip:
url_fseek(s->pb, next, SEEK_SET);
- return AVERROR(EAGAIN);
+ continue;
}
/* skip empty data packets */
@@ -372,7 +373,7 @@ static int flv_read_packet(AVFormatConte
|| st->discard >= AVDISCARD_ALL
){
url_fseek(s->pb, next, SEEK_SET);
- return AVERROR(EAGAIN);
+ continue;
}
if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY)
av_add_index_entry(st, pos, dts, size, 0, AVINDEX_KEYFRAME);
@@ -435,7 +436,7 @@ static int flv_read_packet(AVFormatConte
st->codec->channels, st->codec->sample_rate);
}
- return AVERROR(EAGAIN);
+ goto retry;
}
}
Modified: branches/0.5/libavformat/utils.c
==============================================================================
--- branches/0.5/libavformat/utils.c Mon Mar 2 20:42:31 2009 (r17736)
+++ branches/0.5/libavformat/utils.c Mon Mar 2 21:32:24 2009 (r17737)
@@ -1515,10 +1515,7 @@ static int av_seek_frame_generic(AVForma
return ret;
}
for(i=0;; i++) {
- int ret;
- do{
- ret = av_read_frame(s, &pkt);
- }while(ret == AVERROR(EAGAIN));
+ int ret = av_read_frame(s, &pkt);
if(ret<0)
break;
av_free_packet(&pkt);
@@ -1741,9 +1738,7 @@ static void av_estimate_timings_from_pts
if (i == ic->nb_streams)
break;
- do{
- ret = av_read_packet(ic, pkt);
- }while(ret == AVERROR(EAGAIN));
+ ret = av_read_packet(ic, pkt);
if (ret != 0)
break;
read_size += pkt->size;
@@ -1768,9 +1763,7 @@ static void av_estimate_timings_from_pts
if (read_size >= DURATION_MAX_READ_SIZE)
break;
- do{
- ret = av_read_packet(ic, pkt);
- }while(ret == AVERROR(EAGAIN));
+ ret = av_read_packet(ic, pkt);
if (ret != 0)
break;
read_size += pkt->size;
@@ -2079,8 +2072,6 @@ int av_find_stream_info(AVFormatContext
/* NOTE: a new stream can be added there if no header in file
(AVFMTCTX_NOHEADER) */
ret = av_read_frame_internal(ic, &pkt1);
- if(ret == AVERROR(EAGAIN))
- continue;
if (ret < 0) {
/* EOF or error */
ret = -1; /* we could not have all the codec parameters before EOF */
More information about the ffmpeg-cvslog
mailing list