mirror of
https://github.com/mpv-player/mpv
synced 2025-01-28 18:53:02 +00:00
Merge svn changes up to r30672
This commit is contained in:
commit
327463be52
@ -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
|
#ifndef MPLAYER_CFG_MPLAYER_DEF_H
|
||||||
#define MPLAYER_CFG_MPLAYER_DEF_H
|
#define MPLAYER_CFG_MPLAYER_DEF_H
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ demuxer_t *new_demuxer(struct MPOpts *opts, stream_t *stream, int type,
|
|||||||
"big troubles ahead.");
|
"big troubles ahead.");
|
||||||
if (filename) // Filename hack for avs_check_file
|
if (filename) // Filename hack for avs_check_file
|
||||||
d->filename = strdup(filename);
|
d->filename = strdup(filename);
|
||||||
stream_reset(stream);
|
stream->eof = 0;
|
||||||
stream_seek(stream, stream->start_pos);
|
stream_seek(stream, stream->start_pos);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@ -366,8 +366,8 @@ void free_sh_video(sh_video_t *sh)
|
|||||||
void free_demuxer(demuxer_t *demuxer)
|
void free_demuxer(demuxer_t *demuxer)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
mp_msg(MSGT_DEMUXER, MSGL_DBG2, "DEMUXER: freeing demuxer at %p\n",
|
mp_msg(MSGT_DEMUXER, MSGL_DBG2, "DEMUXER: freeing %s demuxer at %p\n",
|
||||||
demuxer);
|
demuxer->desc->shortdesc, demuxer);
|
||||||
if (demuxer->desc->close)
|
if (demuxer->desc->close)
|
||||||
demuxer->desc->close(demuxer);
|
demuxer->desc->close(demuxer);
|
||||||
// Very ugly hack to make it behave like old implementation
|
// Very ugly hack to make it behave like old implementation
|
||||||
|
@ -374,6 +374,9 @@ http_seek( stream_t *stream, off_t pos ) {
|
|||||||
|
|
||||||
if( http_hdr==NULL ) return 0;
|
if( http_hdr==NULL ) return 0;
|
||||||
|
|
||||||
|
if( mp_msg_test(MSGT_NETWORK,MSGL_V) )
|
||||||
|
http_debug_hdr( http_hdr );
|
||||||
|
|
||||||
switch( http_hdr->status_code ) {
|
switch( http_hdr->status_code ) {
|
||||||
case 200:
|
case 200:
|
||||||
case 206: // OK
|
case 206: // OK
|
||||||
@ -388,7 +391,7 @@ http_seek( stream_t *stream, off_t pos ) {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Server returns %d: %s\n", http_hdr->status_code, http_hdr->reason_phrase );
|
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;
|
fd = -1;
|
||||||
}
|
}
|
||||||
stream->fd = fd;
|
stream->fd = fd;
|
||||||
|
@ -261,7 +261,7 @@ stream_t *open_output_stream(char *filename, struct MPOpts *options)
|
|||||||
|
|
||||||
int stream_fill_buffer(stream_t *s){
|
int stream_fill_buffer(stream_t *s){
|
||||||
int len;
|
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){
|
switch(s->type){
|
||||||
case STREAMTYPE_STREAM:
|
case STREAMTYPE_STREAM:
|
||||||
#ifdef CONFIG_NETWORK
|
#ifdef CONFIG_NETWORK
|
||||||
@ -282,7 +282,7 @@ int stream_fill_buffer(stream_t *s){
|
|||||||
default:
|
default:
|
||||||
len= s->fill_buffer ? s->fill_buffer(s,s->buffer,STREAM_BUFFER_SIZE) : 0;
|
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_pos=0;
|
||||||
s->buf_len=len;
|
s->buf_len=len;
|
||||||
s->pos+=len;
|
s->pos+=len;
|
||||||
@ -393,8 +393,8 @@ return 1;
|
|||||||
|
|
||||||
void stream_reset(stream_t *s){
|
void stream_reset(stream_t *s){
|
||||||
if(s->eof){
|
if(s->eof){
|
||||||
s->pos=0; //ftell(f);
|
s->pos=0;
|
||||||
// s->buf_pos=s->buf_len=0;
|
s->buf_pos=s->buf_len=0;
|
||||||
s->eof=0;
|
s->eof=0;
|
||||||
}
|
}
|
||||||
if(s->control) s->control(s,STREAM_CTRL_RESET,NULL);
|
if(s->control) s->control(s,STREAM_CTRL_RESET,NULL);
|
||||||
|
@ -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);
|
mp_dbg(MSGT_DEMUX, MSGL_DBG3, "seek to 0x%qX\n",(long long)pos);
|
||||||
|
|
||||||
|
if(s->eof)
|
||||||
|
return 0;
|
||||||
if(pos<s->pos){
|
if(pos<s->pos){
|
||||||
off_t x=pos-(s->pos-s->buf_len);
|
off_t x=pos-(s->pos-s->buf_len);
|
||||||
if(x>=0){
|
if(x>=0){
|
||||||
|
1390
stream/stream_cddb.c
1390
stream/stream_cddb.c
File diff suppressed because it is too large
Load Diff
@ -548,9 +548,9 @@ int dvb_set_channel(stream_t *stream, int card, int n)
|
|||||||
stream->fd = priv->dvr_fd;
|
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);
|
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->buf_pos = stream->buf_len = 0;
|
||||||
stream_reset(stream);
|
stream->pos = 0;
|
||||||
|
stream->eof = 0;
|
||||||
|
|
||||||
if(channel->freq != priv->last_freq)
|
if(channel->freq != priv->last_freq)
|
||||||
if (! dvb_tune(priv, channel->freq, channel->pol, channel->srate, channel->diseqc, channel->tone,
|
if (! dvb_tune(priv, channel->freq, channel->pol, channel->srate, channel->diseqc, channel->tone,
|
||||||
|
Loading…
Reference in New Issue
Block a user