Skip to content

Commit

Permalink
Merge svn changes up to r30672
Browse files Browse the repository at this point in the history
  • Loading branch information
Uoti Urpala committed Mar 9, 2010
2 parents 7e90be7 + 88a8591 commit 327463b
Show file tree
Hide file tree
Showing 7 changed files with 801 additions and 744 deletions.
18 changes: 18 additions & 0 deletions cfg-mplayer-def.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* MPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef MPLAYER_CFG_MPLAYER_DEF_H
#define MPLAYER_CFG_MPLAYER_DEF_H

Expand Down
6 changes: 3 additions & 3 deletions libmpdemux/demuxer.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ demuxer_t *new_demuxer(struct MPOpts *opts, stream_t *stream, int type,
"big troubles ahead.");
if (filename) // Filename hack for avs_check_file
d->filename = strdup(filename);
stream_reset(stream);
stream->eof = 0;
stream_seek(stream, stream->start_pos);
return d;
}
Expand Down Expand Up @@ -366,8 +366,8 @@ void free_sh_video(sh_video_t *sh)
void free_demuxer(demuxer_t *demuxer)
{
int i;
mp_msg(MSGT_DEMUXER, MSGL_DBG2, "DEMUXER: freeing demuxer at %p\n",
demuxer);
mp_msg(MSGT_DEMUXER, MSGL_DBG2, "DEMUXER: freeing %s demuxer at %p\n",
demuxer->desc->shortdesc, demuxer);
if (demuxer->desc->close)
demuxer->desc->close(demuxer);
// Very ugly hack to make it behave like old implementation
Expand Down
5 changes: 4 additions & 1 deletion stream/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ http_seek( stream_t *stream, off_t pos ) {

if( http_hdr==NULL ) return 0;

if( mp_msg_test(MSGT_NETWORK,MSGL_V) )
http_debug_hdr( http_hdr );

switch( http_hdr->status_code ) {
case 200:
case 206: // OK
Expand All @@ -388,7 +391,7 @@ http_seek( stream_t *stream, off_t pos ) {
break;
default:
mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Server returns %d: %s\n", http_hdr->status_code, http_hdr->reason_phrase );
close( fd );
closesocket( fd );
fd = -1;
}
stream->fd = fd;
Expand Down
8 changes: 4 additions & 4 deletions stream/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ stream_t *open_output_stream(char *filename, struct MPOpts *options)

int stream_fill_buffer(stream_t *s){
int len;
if (/*s->fd == NULL ||*/ s->eof) { s->buf_pos = s->buf_len = 0; return 0; }
if (/*s->fd == NULL ||*/ s->eof) { return 0; }
switch(s->type){
case STREAMTYPE_STREAM:
#ifdef CONFIG_NETWORK
Expand All @@ -282,7 +282,7 @@ int stream_fill_buffer(stream_t *s){
default:
len= s->fill_buffer ? s->fill_buffer(s,s->buffer,STREAM_BUFFER_SIZE) : 0;
}
if(len<=0){ s->eof=1; s->buf_pos=s->buf_len=0; return 0; }
if(len<=0){ s->eof=1; return 0; }
s->buf_pos=0;
s->buf_len=len;
s->pos+=len;
Expand Down Expand Up @@ -393,8 +393,8 @@ return 1;

void stream_reset(stream_t *s){
if(s->eof){
s->pos=0; //ftell(f);
// s->buf_pos=s->buf_len=0;
s->pos=0;
s->buf_pos=s->buf_len=0;
s->eof=0;
}
if(s->control) s->control(s,STREAM_CTRL_RESET,NULL);
Expand Down
2 changes: 2 additions & 0 deletions stream/stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ inline static int stream_seek(stream_t *s,off_t pos){

mp_dbg(MSGT_DEMUX, MSGL_DBG3, "seek to 0x%qX\n",(long long)pos);

if(s->eof)
return 0;
if(pos<s->pos){
off_t x=pos-(s->pos-s->buf_len);
if(x>=0){
Expand Down
Loading

0 comments on commit 327463b

Please sign in to comment.