mirror of
https://github.com/mpv-player/mpv
synced 2025-02-28 03:10:55 +00:00
- initial support for MPEG4 in TS (M4V is working, but not AAC yet)
patch by Nico <nsabbi@libero.it> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10688 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
511946aa0a
commit
38f4f0b4cf
@ -216,6 +216,7 @@ void free_demuxer(demuxer_t *demuxer){
|
||||
demux_close_gif(demuxer); break;
|
||||
#endif
|
||||
case DEMUXER_TYPE_MPEG_TS:
|
||||
case DEMUXER_TYPE_MPEG4_IN_TS:
|
||||
demux_close_ts(demuxer); break;
|
||||
case DEMUXER_TYPE_REALAUDIO:
|
||||
demux_close_ra(demuxer); break;
|
||||
@ -358,7 +359,9 @@ int demux_fill_buffer(demuxer_t *demux,demux_stream_t *ds){
|
||||
#ifdef HAVE_GIF
|
||||
case DEMUXER_TYPE_GIF: return demux_gif_fill_buffer(demux);
|
||||
#endif
|
||||
case DEMUXER_TYPE_MPEG_TS: return demux_ts_fill_buffer(demux);
|
||||
case DEMUXER_TYPE_MPEG_TS:
|
||||
case DEMUXER_TYPE_MPEG4_IN_TS:
|
||||
return demux_ts_fill_buffer(demux);
|
||||
case DEMUXER_TYPE_REALAUDIO: return demux_ra_fill_buffer(demux);
|
||||
}
|
||||
return 0;
|
||||
@ -1259,7 +1262,8 @@ switch(file_format){
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case DEMUXER_TYPE_MPEG_TS: {
|
||||
case DEMUXER_TYPE_MPEG_TS:
|
||||
case DEMUXER_TYPE_MPEG4_IN_TS: {
|
||||
demux_open_ts(demuxer);
|
||||
break;
|
||||
}
|
||||
@ -1462,6 +1466,7 @@ switch(demuxer->file_format){
|
||||
demux_mkv_seek(demuxer,rel_seek_secs,flags); break;
|
||||
#endif
|
||||
case DEMUXER_TYPE_MPEG_TS:
|
||||
case DEMUXER_TYPE_MPEG4_IN_TS:
|
||||
demux_seek_ts(demuxer,rel_seek_secs,flags); break;
|
||||
|
||||
} // switch(demuxer->file_format)
|
||||
@ -1533,6 +1538,8 @@ int demux_control(demuxer_t *demuxer, int cmd, void *arg) {
|
||||
case DEMUXER_TYPE_MPEG4_ES:
|
||||
case DEMUXER_TYPE_MPEG_ES:
|
||||
case DEMUXER_TYPE_MPEG_PS:
|
||||
case DEMUXER_TYPE_MPEG_TS:
|
||||
case DEMUXER_TYPE_MPEG4_IN_TS:
|
||||
return demux_mpg_control(demuxer,cmd,arg);
|
||||
case DEMUXER_TYPE_ASF:
|
||||
return demux_asf_control(demuxer,cmd,arg);
|
||||
|
@ -42,6 +42,7 @@
|
||||
#define DEMUXER_TYPE_MATROSKA 31
|
||||
#define DEMUXER_TYPE_REALAUDIO 32
|
||||
#define DEMUXER_TYPE_MPEG_TY 33
|
||||
#define DEMUXER_TYPE_MPEG4_IN_TS 34
|
||||
|
||||
// This should always match the higest demuxer type number.
|
||||
// Unless you want to disallow users to force the demuxer to some types
|
||||
@ -155,6 +156,21 @@ inline static demux_packet_t* new_demux_packet(int len){
|
||||
return dp;
|
||||
}
|
||||
|
||||
inline static void resize_demux_packet(demux_packet_t* dp, int len)
|
||||
{
|
||||
if(len)
|
||||
{
|
||||
dp->buffer=(unsigned char *)realloc(dp->buffer,len+8);
|
||||
memset(dp->buffer+len,0,8);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(dp->buffer) free(dp->buffer);
|
||||
dp->buffer=NULL;
|
||||
}
|
||||
dp->len=len;
|
||||
}
|
||||
|
||||
inline static demux_packet_t* clone_demux_packet(demux_packet_t* pack){
|
||||
demux_packet_t* dp=(demux_packet_t*)malloc(sizeof(demux_packet_t));
|
||||
while(pack->master) pack=pack->master; // find the master
|
||||
|
@ -86,7 +86,8 @@ switch(d_video->demuxer->file_format){
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case DEMUXER_TYPE_MPEG4_ES: {
|
||||
case DEMUXER_TYPE_MPEG4_ES:
|
||||
case DEMUXER_TYPE_MPEG4_IN_TS: {
|
||||
videobuf_len=0; videobuf_code_len=0;
|
||||
mp_msg(MSGT_DECVIDEO,MSGL_V,"Searching for Video Object Start code... ");fflush(stdout);
|
||||
while(1){
|
||||
@ -410,7 +411,7 @@ int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char**
|
||||
telecine=1;
|
||||
}
|
||||
|
||||
} else if(demuxer->file_format==DEMUXER_TYPE_MPEG4_ES){
|
||||
} else if((demuxer->file_format==DEMUXER_TYPE_MPEG4_ES) || (demuxer->file_format==DEMUXER_TYPE_MPEG4_IN_TS)){
|
||||
//
|
||||
while(videobuf_len<VIDEOBUFFER_SIZE-MAX_VIDEO_PACKET_SIZE){
|
||||
int i=sync_video_packet(d_video);
|
||||
|
Loading…
Reference in New Issue
Block a user