diff options
author | 2008-09-03 10:16:30 +0300 | |
---|---|---|
committer | 2008-09-03 10:16:30 +0300 | |
commit | b56858342fdbe48489618107df75e5bd0451eb0b (patch) | |
tree | 5d41ef858502bae99dcbebdd728d42a6040adb03 /libmpdemux | |
parent | 8ea7eb77fc7ba8bd0b596ea32ee60909a012828f (diff) | |
parent | bae94777d7ddaa2d4763507fdb93b9520327c9d1 (diff) |
Merge svn changes up to r27514
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/asf.h | 14 | ||||
-rw-r--r-- | libmpdemux/demux_lavf.c | 16 | ||||
-rw-r--r-- | libmpdemux/extension.c | 1 | ||||
-rw-r--r-- | libmpdemux/mp_taglists.c | 7 | ||||
-rw-r--r-- | libmpdemux/video.c | 1 |
5 files changed, 22 insertions, 17 deletions
diff --git a/libmpdemux/asf.h b/libmpdemux/asf.h index 1f89edf7fb..1e6210e603 100644 --- a/libmpdemux/asf.h +++ b/libmpdemux/asf.h @@ -7,20 +7,6 @@ #include "mpbswap.h" /////////////////////// -// MS GUID definition -/////////////////////// -#ifndef GUID_DEFINED -#define GUID_DEFINED -// Size of GUID is 16 bytes! -typedef struct __attribute__((packed)) { - uint32_t Data1; // 4 bytes - uint16_t Data2; // 2 bytes - uint16_t Data3; // 2 bytes - uint8_t Data4[8]; // 8 bytes -} GUID_t; -#endif - -/////////////////////// // ASF Object Header /////////////////////// typedef struct __attribute__((packed)) { diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index be820a24a7..73b81807c8 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -95,6 +95,7 @@ static int mp_read(void *opaque, uint8_t *buf, int size) { static offset_t mp_seek(void *opaque, offset_t pos, int whence) { stream_t *stream = opaque; + offset_t current_pos; mp_msg(MSGT_HEADER,MSGL_DBG2,"mp_seek(%p, %d, %d)\n", stream, (int)pos, whence); if(whence == SEEK_CUR) pos +=stream_tell(stream); @@ -111,8 +112,12 @@ static offset_t mp_seek(void *opaque, offset_t pos, int whence) { return -1; if(pos<stream->end_pos && stream->eof) stream_reset(stream); - if(stream_seek(stream, pos)==0) + current_pos = stream_tell(stream); + if(stream_seek(stream, pos)==0) { + stream_reset(stream); + stream_seek(stream, current_pos); return -1; + } return pos - stream->start_pos; } @@ -176,6 +181,7 @@ static const char *preferred_list[] = { "mov,mp4,m4a,3gp,3g2,mj2", "mpc", "mpc8", + "matroska", NULL }; @@ -336,8 +342,12 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) { sh_video->fps=av_q2d(st->r_frame_rate); sh_video->frametime=1/av_q2d(st->r_frame_rate); sh_video->format=bih->biCompression; - sh_video->aspect=codec->width * codec->sample_aspect_ratio.num - / (float)(codec->height * codec->sample_aspect_ratio.den); + if(st->sample_aspect_ratio.num) + sh_video->aspect = codec->width * st->sample_aspect_ratio.num + / (float)(codec->height * st->sample_aspect_ratio.den); + else + sh_video->aspect=codec->width * codec->sample_aspect_ratio.num + / (float)(codec->height * codec->sample_aspect_ratio.den); sh_video->i_bps=codec->bit_rate/8; mp_msg(MSGT_DEMUX,MSGL_DBG2,"aspect= %d*%d/(%d*%d)\n", codec->width, codec->sample_aspect_ratio.num, diff --git a/libmpdemux/extension.c b/libmpdemux/extension.c index a1cd2a49d2..88cc17f3a7 100644 --- a/libmpdemux/extension.c +++ b/libmpdemux/extension.c @@ -61,6 +61,7 @@ static struct { { "ac3", DEMUXER_TYPE_LAVF }, { "ape", DEMUXER_TYPE_LAVF }, { "apl", DEMUXER_TYPE_LAVF }, + { "eac3",DEMUXER_TYPE_LAVF }, { "mac", DEMUXER_TYPE_LAVF }, { "str", DEMUXER_TYPE_LAVF }, diff --git a/libmpdemux/mp_taglists.c b/libmpdemux/mp_taglists.c index d6e4f94de5..275112ac1a 100644 --- a/libmpdemux/mp_taglists.c +++ b/libmpdemux/mp_taglists.c @@ -22,6 +22,8 @@ #include "libavformat/riff.h" static const AVCodecTag mp_wav_tags[] = { + { CODEC_ID_RA_144, MKTAG('1', '4', '_', '4')}, + { CODEC_ID_RA_288, MKTAG('2', '8', '_', '8')}, { CODEC_ID_ADPCM_4XM, MKTAG('4', 'X', 'M', 'A')}, { CODEC_ID_ADPCM_EA, MKTAG('A', 'D', 'E', 'A')}, { CODEC_ID_ADPCM_EA_MAXIS_XA, MKTAG('A', 'D', 'X', 'A')}, @@ -31,6 +33,7 @@ static const AVCodecTag mp_wav_tags[] = { { CODEC_ID_AMR_NB, MKTAG('n', 'b', 0, 0)}, { CODEC_ID_COOK, MKTAG('c', 'o', 'o', 'k')}, { CODEC_ID_DSICINAUDIO, MKTAG('D', 'C', 'I', 'A')}, + { CODEC_ID_EAC3, MKTAG('E', 'A', 'C', '3')}, { CODEC_ID_INTERPLAY_DPCM, MKTAG('I', 'N', 'P', 'A')}, { CODEC_ID_MLP, MKTAG('M', 'L', 'P', ' ')}, { CODEC_ID_MUSEPACK7, MKTAG('M', 'P', 'C', ' ')}, @@ -75,6 +78,10 @@ static const AVCodecTag mp_bmp_tags[] = { { CODEC_ID_MOTIONPIXELS, MKTAG('M', 'V', 'I', '1')}, { CODEC_ID_RL2, MKTAG('R', 'L', '2', 'V')}, { CODEC_ID_ROQ, MKTAG('R', 'o', 'Q', 'V')}, + { CODEC_ID_RV10, MKTAG('R', 'V', '1', '0')}, + { CODEC_ID_RV20, MKTAG('R', 'V', '2', '0')}, + { CODEC_ID_RV30, MKTAG('R', 'V', '3', '0')}, + { CODEC_ID_RV40, MKTAG('R', 'V', '4', '0')}, { CODEC_ID_THP, MKTAG('T', 'H', 'P', 'V')}, { CODEC_ID_TIERTEXSEQVIDEO, MKTAG('T', 'S', 'E', 'Q')}, { CODEC_ID_TXD, MKTAG('T', 'X', 'D', 'V')}, diff --git a/libmpdemux/video.c b/libmpdemux/video.c index 0e7dfe618c..1faf077840 100644 --- a/libmpdemux/video.c +++ b/libmpdemux/video.c @@ -587,6 +587,7 @@ int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** } break; case DEMUXER_TYPE_LAVF: + case DEMUXER_TYPE_LAVF_PREFERRED: if((int)sh_video->fps==1000 || (int)sh_video->fps<=1){ double next_pts = ds_get_next_pts(d_video); double d= (next_pts != MP_NOPTS_VALUE) ? next_pts - d_video->pts : d_video->pts-pts1; |