1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-11 09:29:29 +00:00

added get_sh_video/audio and realmedia seeking

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5085 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2002-03-15 15:53:11 +00:00
parent 19332211ba
commit d8c34022bb
2 changed files with 34 additions and 2 deletions

View File

@ -18,6 +18,8 @@
#include "stheader.h"
#include "mf.h"
#include "../libvo/fastmemcpy.h"
void free_demuxer_stream(demux_stream_t *ds){
ds_free_packs(ds);
free(ds);
@ -67,8 +69,19 @@ demuxer_t* new_demuxer(stream_t *stream,int type,int a_id,int v_id,int s_id){
return d;
}
sh_audio_t *get_sh_audio(demuxer_t *demuxer, int id)
{
if(id > MAX_A_STREAMS-1 || id < 0)
{
mp_msg(MSGT_DEMUXER,MSGL_WARN,"Requested audio stream id overflow (%d > %d)\n",
id, MAX_A_STREAMS);
return NULL;
}
return demuxer->a_streams[id];
}
sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id){
if(id > MAX_A_STREAMS-1)
if(id > MAX_A_STREAMS-1 || id < 0)
{
mp_msg(MSGT_DEMUXER,MSGL_WARN,"Requested audio stream id overflow (%d > %d)\n",
id, MAX_A_STREAMS);
@ -91,8 +104,19 @@ void free_sh_audio(sh_audio_t* sh){
free(sh);
}
sh_video_t *get_sh_video(demuxer_t *demuxer, int id)
{
if(id > MAX_V_STREAMS-1 || id < 0)
{
mp_msg(MSGT_DEMUXER,MSGL_WARN,"Requested video stream id overflow (%d > %d)\n",
id, MAX_V_STREAMS);
return NULL;
}
return demuxer->v_streams[id];
}
sh_video_t* new_sh_video(demuxer_t *demuxer,int id){
if(id > MAX_V_STREAMS-1)
if(id > MAX_V_STREAMS-1 || id < 0)
{
mp_msg(MSGT_DEMUXER,MSGL_WARN,"Requested video stream id overflow (%d > %d)\n",
id, MAX_V_STREAMS);
@ -851,6 +875,7 @@ int demux_seek_fli(demuxer_t *demuxer,float rel_seek_secs,int flags);
int demux_seek_mf(demuxer_t *demuxer,float rel_seek_secs,int flags);
int demux_seek_nuv(demuxer_t *demuxer,float rel_seek_secs,int flags);
void demux_seek_mov(demuxer_t *demuxer,float pts,int flags);
int demux_seek_real(demuxer_t *demuxer,float rel_seek_secs,int flags);
extern void demux_audio_seek(demuxer_t *demuxer,float rel_seek_secs,int flags);
extern void demux_demuxers_seek(demuxer_t *demuxer,float rel_seek_secs,int flags);
@ -902,6 +927,9 @@ switch(demuxer->file_format){
case DEMUXER_TYPE_MOV:
demux_seek_mov(demuxer,rel_seek_secs,flags); break;
case DEMUXER_TYPE_REAL:
demux_seek_real(demuxer,rel_seek_secs,flags); break;
case DEMUXER_TYPE_Y4M:
demux_seek_y4m(demuxer,rel_seek_secs,flags); break;

View File

@ -78,8 +78,12 @@ typedef struct {
void* video_out;
} sh_video_t;
sh_audio_t* get_sh_audio(demuxer_t *demuxer,int id);
sh_video_t* get_sh_video(demuxer_t *demuxer,int id);
sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id);
sh_video_t* new_sh_video(demuxer_t *demuxer,int id);
void free_sh_audio(sh_audio_t *sh);
void free_sh_video(sh_video_t *sh);
int video_read_properties(sh_video_t *sh_video);
int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps);