diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2007-08-23 16:42:32 +0000 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2007-08-23 16:42:32 +0000 |
commit | 0e6b14c2a79c193706a84624e83ba5fcc2308052 (patch) | |
tree | a1f34b7c6af983fd08665bb2708f6c1324c4b1ce /ffplay.c | |
parent | 2c2b3130c2b236fa854087f30281956e73acdd9d (diff) | |
download | ffmpeg-0e6b14c2a79c193706a84624e83ba5fcc2308052.tar.gz |
Stray commit reverted
Originally committed as revision 10198 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -1871,7 +1871,7 @@ static int decode_thread(void *arg) { VideoState *is = arg; AVFormatContext *ic; - int err, i, ret, video_index, audio_index; + int err, i, ret, video_index, audio_index, use_play; AVPacket pkt1, *pkt = &pkt1; AVFormatParameters params, *ap = ¶ms; @@ -1885,6 +1885,8 @@ static int decode_thread(void *arg) url_set_interrupt_cb(decode_interrupt_cb); memset(ap, 0, sizeof(*ap)); + ap->initial_pause = 1; /* we force a pause when starting an RTSP + stream */ ap->width = frame_width; ap->height= frame_height; @@ -1898,10 +1900,16 @@ static int decode_thread(void *arg) goto fail; } is->ic = ic; +#ifdef CONFIG_RTSP_DEMUXER + use_play = (ic->iformat == &rtsp_demuxer); +#else + use_play = 0; +#endif if(genpts) ic->flags |= AVFMT_FLAG_GENPTS; + if (!use_play) { err = av_find_stream_info(ic); if (err < 0) { fprintf(stderr, "%s: could not find codec parameters\n", is->filename); @@ -1909,6 +1917,7 @@ static int decode_thread(void *arg) goto fail; } 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) { @@ -1925,6 +1934,18 @@ static int decode_thread(void *arg) } } + /* now we can begin to play (RTSP stream only) */ + av_read_play(ic); + + if (use_play) { + err = av_find_stream_info(ic); + if (err < 0) { + fprintf(stderr, "%s: could not find codec parameters\n", is->filename); + ret = -1; + goto fail; + } + } + for(i = 0; i < ic->nb_streams; i++) { AVCodecContext *enc = ic->streams[i]->codec; switch(enc->codec_type) { |