1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 17:42:17 +00:00

Merge svn changes up to r30672

This commit is contained in:
Uoti Urpala 2010-03-10 00:34:16 +02:00
commit 327463be52
7 changed files with 746 additions and 689 deletions

View File

@ -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

View File

@ -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;
}
@ -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

View File

@ -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
@ -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;

View File

@ -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
@ -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;
@ -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);

View File

@ -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){

File diff suppressed because it is too large Load Diff

View File

@ -548,9 +548,9 @@ int dvb_set_channel(stream_t *stream, int card, int n)
stream->fd = priv->dvr_fd;
mp_msg(MSGT_DEMUX, MSGL_V, "DVB_SET_CHANNEL: new channel name=%s, card: %d, channel %d\n", channel->name, card, n);
stream->eof=1;
stream_reset(stream);
stream->buf_pos = stream->buf_len = 0;
stream->pos = 0;
stream->eof = 0;
if(channel->freq != priv->last_freq)
if (! dvb_tune(priv, channel->freq, channel->pol, channel->srate, channel->diseqc, channel->tone,