# HG changeset patch # User rtogni # Date 1174429958 0 # Node ID 8e7b3260e985cc554dc658ad28b0204db9402c32 # Parent f088d69b166725f5957517caf9069e5bf7860458 Declare eof only when stream 0 gets eof Fixes premature eof on rtsp://vodreal.stanford.edu/opa/philo/061022.rm diff -r f088d69b1667 -r 8e7b3260e985 stream/realrtsp/real.c --- a/stream/realrtsp/real.c Tue Mar 20 22:30:51 2007 +0000 +++ b/stream/realrtsp/real.c Tue Mar 20 22:32:38 2007 +0000 @@ -359,7 +359,15 @@ #ifdef LOG printf("got flags1: 0x%02x\n",flags1); #endif - if(header[6] == 0x06) { + if(header[6] == 0x06) { // eof packet + rtsp_read_data(rtsp_session, header, 7); // Skip the rest of the eof packet + /* Some files have short auxiliary streams, we must ignore eof packets + * for these streams to avoid premature eof. + * Now the code declares eof only if the stream with id == 0 gets eof + * (old code was: eof on the first eof packet received). + */ + if(flags1 & 0x7c) // ignore eof for streams with id != 0 + return 0; mp_msg(MSGT_STREAM, MSGL_INFO, "realrtsp: Stream EOF detected\n"); return -1; }