diff options
author | James Stembridge <jstembridge@users.sourceforge.net> | 2003-05-26 12:32:40 +0000 |
---|---|---|
committer | James Stembridge <jstembridge@users.sourceforge.net> | 2003-05-26 12:32:40 +0000 |
commit | df2a3a3ab0a017b0ab97974fadbbf3430a771325 (patch) | |
tree | 7c9b9095dcb9b8f23b7083acca8961ccce898d31 /src | |
parent | 0f74b5b78c77f9458fe2c68d00bd058065bbd01c (diff) | |
download | xine-lib-df2a3a3ab0a017b0ab97974fadbbf3430a771325.tar.gz xine-lib-df2a3a3ab0a017b0ab97974fadbbf3430a771325.tar.bz2 |
Only play number of packets specified in header. Otherwise index chunk data can be mistaken for stream data which doesn't sound/look very nice.
CVS patchset: 4945
CVS date: 2003/05/26 12:32:40
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_real.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index f0052bd3f..63975822d 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -28,7 +28,7 @@ * * Based on FFmpeg's libav/rm.c. * - * $Id: demux_real.c,v 1.53 2003/05/26 11:57:45 jstembridge Exp $ + * $Id: demux_real.c,v 1.54 2003/05/26 12:32:40 jstembridge Exp $ */ #ifdef HAVE_CONFIG_H @@ -108,7 +108,8 @@ typedef struct { off_t data_size; int status; unsigned int duration; - int packet_count; + unsigned int packet_count; + unsigned int current_packet; int video_stream_num; uint32_t video_buf_type; @@ -371,6 +372,7 @@ static void real_parse_headers (demux_real_t *this) { this->data_start = 0; this->data_size = 0; + this->current_packet = 0; if ((this->input->get_capabilities (this->input) & INPUT_CAP_SEEKABLE) != 0) this->input->seek (this->input, 0, SEEK_SET); @@ -1101,6 +1103,14 @@ discard: this->input->seek(this->input, size, SEEK_CUR); } + + if(this->packet_count && (this->current_packet == (this->packet_count - 1))) { +#ifdef LOG + printf("demux_real: read all packets\n"); +#endif + this->status = DEMUX_FINISHED; + } else + this->current_packet++; #if 0 @@ -1221,6 +1231,9 @@ static int demux_real_seek (demux_plugin_t *this_gen, this->input->seek(this->input, index[i].offset, SEEK_SET); + /* is packet number global or is it local to current data chunk? */ + this->current_packet = index[i].packetno; + if(this->stream->demux_thread_running) { this->buf_flag_seek = 1; xine_demux_flush_engine(this->stream); |