aboutsummaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorBjörn Axelsson2007-11-21 07:41:00 +0000
committerAndreas Öman2007-11-21 07:41:00 +0000
commit899681cd1dbf4cd7c3b86af23bca25e20a54f4d0 (patch)
tree6f4556497efab1d703d1289b170c936154c6bbd5 /ffplay.c
parent79815f622d90499f882ad968a1351134535cbbab (diff)
Use dynamically allocated ByteIOContext in AVFormatContext
patch by: Björn Axelsson, bjorn d axelsson a intinor d se thread: [PATCH] Remove static ByteIOContexts, 06 nov 2007 Originally committed as revision 11071 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ffplay.c b/ffplay.c
index 43a1905e72..37282d3277 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1912,7 +1912,8 @@ static int decode_thread(void *arg)
ret = -1;
goto fail;
}
- ic->pb.eof_reached= 0; //FIXME hack, ffplay maybe should not use url_feof() to test for the end
+ if(ic->pb)
+ ic->pb->eof_reached= 0; //FIXME hack, ffplay maybe should not use url_feof() to test for the end
/* if seeking requested, we execute it */
if (start_time != AV_NOPTS_VALUE) {
@@ -1980,7 +1981,7 @@ static int decode_thread(void *arg)
#if defined(CONFIG_RTSP_DEMUXER) || defined(CONFIG_MMSH_PROTOCOL)
if (is->paused &&
(!strcmp(ic->iformat->name, "rtsp") ||
- !strcmp(url_fileno(&ic->pb)->prot->name, "mmsh"))) {
+ (ic->pb && !strcmp(url_fileno(ic->pb)->prot->name, "mmsh")))) {
/* wait 10 ms to avoid trying to get another packet */
/* XXX: horrible */
SDL_Delay(10);
@@ -2023,14 +2024,14 @@ static int decode_thread(void *arg)
if (is->audioq.size > MAX_AUDIOQ_SIZE ||
is->videoq.size > MAX_VIDEOQ_SIZE ||
is->subtitleq.size > MAX_SUBTITLEQ_SIZE ||
- url_feof(&ic->pb)) {
+ url_feof(ic->pb)) {
/* wait 10 ms */
SDL_Delay(10);
continue;
}
ret = av_read_frame(ic, pkt);
if (ret < 0) {
- if (url_ferror(&ic->pb) == 0) {
+ if (url_ferror(ic->pb) == 0) {
SDL_Delay(100); /* wait for user event */
continue;
} else
@@ -2282,7 +2283,7 @@ static void event_loop(void)
do_seek:
if (cur_stream) {
if (seek_by_bytes) {
- pos = url_ftell(&cur_stream->ic->pb);
+ pos = url_ftell(cur_stream->ic->pb);
if (cur_stream->ic->bit_rate)
incr *= cur_stream->ic->bit_rate / 60.0;
else