Mercurial > mplayer.hg
changeset 22231:da19b4ccb83a
cosmetics
author | nicodvb |
---|---|
date | Sat, 17 Feb 2007 17:24:07 +0000 |
parents | d655ce625259 |
children | d0b60d14d8d7 |
files | libmpdemux/demux_ts.c |
diffstat | 1 files changed, 29 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_ts.c Sat Feb 17 16:30:59 2007 +0000 +++ b/libmpdemux/demux_ts.c Sat Feb 17 17:24:07 2007 +0000 @@ -2460,7 +2460,7 @@ return &(priv->pmt[i]); } } - } + } } } @@ -2528,34 +2528,34 @@ if((*dp != NULL) && (*dp_offset > 0)) { - ret = *dp_offset; - resize_demux_packet(*dp, ret); //shrinked to the right size - ds_add_packet(ds, *dp); - mp_msg(MSGT_DEMUX, MSGL_DBG2, "ADDED %d bytes to %s fifo, PTS=%.3f\n", ret, (ds == demuxer->audio ? "audio" : (ds == demuxer->video ? "video" : "sub")), (*dp)->pts); - if(si) + ret = *dp_offset; + resize_demux_packet(*dp, ret); //shrinked to the right size + ds_add_packet(ds, *dp); + mp_msg(MSGT_DEMUX, MSGL_DBG2, "ADDED %d bytes to %s fifo, PTS=%.3f\n", ret, (ds == demuxer->audio ? "audio" : (ds == demuxer->video ? "video" : "sub")), (*dp)->pts); + if(si) + { + float diff = (*dp)->pts - si->last_pts; + float dur; + + if(abs(diff) > 1) //1 second, there's a discontinuity { - float diff = (*dp)->pts - si->last_pts; - float dur; - - if(abs(diff) > 1) //1 second, there's a discontinuity - { - si->duration += si->last_pts - si->first_pts; - si->first_pts = si->last_pts = (*dp)->pts; - } - else - { - si->last_pts = (*dp)->pts; - } - si->size += ret; - dur = si->duration + (si->last_pts - si->first_pts); - - if(dur > 0 && ds == demuxer->video) - { - ts_priv_t * priv = (ts_priv_t*) demuxer->priv; - if(dur > 1) //otherwise it may be unreliable - priv->vbitrate = (uint32_t) ((float) si->size / dur); - } + si->duration += si->last_pts - si->first_pts; + si->first_pts = si->last_pts = (*dp)->pts; + } + else + { + si->last_pts = (*dp)->pts; } + si->size += ret; + dur = si->duration + (si->last_pts - si->first_pts); + + if(dur > 0 && ds == demuxer->video) + { + ts_priv_t * priv = (ts_priv_t*) demuxer->priv; + if(dur > 1) //otherwise it may be unreliable + priv->vbitrate = (uint32_t) ((float) si->size / dur); + } + } } *dp = NULL; @@ -3101,7 +3101,6 @@ else { // time seek (secs) - if(! video_stats) // unspecified or VBR newpos += 2324*75*rel_seek_secs; // 174.3 kbyte/sec else @@ -3152,10 +3151,8 @@ { if(i==0x1B3 || i==0x1B8) break; // found it! } - else if(sh_video->format == VIDEO_MPEG4) - { - if(i==0x1B6) break; // found it! - } + else if((sh_video->format == VIDEO_MPEG4) && (i==0x1B6)) + break; else if(sh_video->format == VIDEO_VC1 && (i==0x10E || i==0x10F)) break; else //H264