mirror of
https://github.com/mpv-player/mpv
synced 2025-01-31 20:21:49 +00:00
Set i_bps for ASF video streams according to extended stream properties
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23375 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
6e13c348c3
commit
e5113fdfec
@ -241,6 +241,7 @@ struct asf_priv {
|
||||
int aud_ext_timing_index;
|
||||
int vid_ext_frame_index;
|
||||
int know_frame_time;
|
||||
unsigned bps;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -198,6 +198,7 @@ static int get_ext_stream_properties(char *buf, int buf_len, int stream_num, str
|
||||
int pos=0;
|
||||
uint8_t *buffer = &buf[0];
|
||||
uint64_t avg_ft;
|
||||
unsigned bitrate;
|
||||
|
||||
while ((pos = find_asf_guid(buf, asf_ext_stream_header, pos, buf_len)) >= 0) {
|
||||
int this_stream_num, stnamect, payct, i, objlen;
|
||||
@ -213,7 +214,9 @@ static int get_ext_stream_properties(char *buf, int buf_len, int stream_num, str
|
||||
// max-object-size(4),
|
||||
// flags(4) (reliable,seekable,no_cleanpoints?,resend-live-cleanpoints, rest of bits reserved)
|
||||
|
||||
buffer +=8+8+4+4+4+4+4+4+4+4;
|
||||
buffer += 8+8;
|
||||
bitrate = AV_RL32(buffer);
|
||||
buffer += 8*4;
|
||||
this_stream_num=AV_RL16(buffer);buffer+=2;
|
||||
|
||||
if (this_stream_num == stream_num) {
|
||||
@ -222,6 +225,7 @@ static int get_ext_stream_properties(char *buf, int buf_len, int stream_num, str
|
||||
buffer+=2; //skip stream-language-id-index
|
||||
avg_ft = AV_RL64(buffer); // provided in 100ns units
|
||||
buffer+=8;
|
||||
asf->bps = bitrate / 8;
|
||||
|
||||
// after this are values for stream-name-count and
|
||||
// payload-extension-system-count
|
||||
@ -556,6 +560,7 @@ int read_asf_header(demuxer_t *demuxer,struct asf_priv* asf){
|
||||
sh_video->aspect = asp_ratio * sh_video->bih->biWidth /
|
||||
sh_video->bih->biHeight;
|
||||
}
|
||||
sh_video->i_bps = asf->bps;
|
||||
|
||||
if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_video_header(sh_video->bih, MSGL_V);
|
||||
//asf_video_id=streamh.stream_no & 0x7F;
|
||||
|
@ -715,7 +715,6 @@ static demuxer_t* demux_open_asf(demuxer_t* demuxer)
|
||||
} else {
|
||||
sh_video=demuxer->video->sh;sh_video->ds=demuxer->video;
|
||||
sh_video->fps=1000.0f; sh_video->frametime=0.001f;
|
||||
//sh_video->i_bps=10*asf->packetsize; // FIXME!
|
||||
|
||||
if (asf->asf_is_dvr_ms) {
|
||||
sh_video->bih->biWidth = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user