summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2005-05-06 18:00:54 +0000
committerMike Melanson <mike@multimedia.cx>2005-05-06 18:00:54 +0000
commiteed0d8c57fb0c0a7917a820dfc009baf81f223c0 (patch)
tree499bad8952797fc03e2fa5061634e776695c68b4 /src
parentcd67c39cbf187e82ecc7337183d505e3743142fd (diff)
downloadxine-lib-eed0d8c57fb0c0a7917a820dfc009baf81f223c0.tar.gz
xine-lib-eed0d8c57fb0c0a7917a820dfc009baf81f223c0.tar.bz2
minor H.264 fix
CVS patchset: 7526 CVS date: 2005/05/06 18:00:54
Diffstat (limited to 'src')
-rw-r--r--src/libffmpeg/libavcodec/h264.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libffmpeg/libavcodec/h264.c b/src/libffmpeg/libavcodec/h264.c
index 9048886bd..0cd04f923 100644
--- a/src/libffmpeg/libavcodec/h264.c
+++ b/src/libffmpeg/libavcodec/h264.c
@@ -3697,6 +3697,11 @@ static int init_poc(H264Context *h){
if(h->sps.poc_type==0){
const int max_poc_lsb= 1<<h->sps.log2_max_poc_lsb;
+ if(h->nal_unit_type == NAL_IDR_SLICE){
+ h->prev_poc_msb=
+ h->prev_poc_lsb= 0;
+ }
+
if (h->poc_lsb < h->prev_poc_lsb && h->prev_poc_lsb - h->poc_lsb >= max_poc_lsb/2)
h->poc_msb = h->prev_poc_msb + max_poc_lsb;
else if(h->poc_lsb > h->prev_poc_lsb && h->prev_poc_lsb - h->poc_lsb < -max_poc_lsb/2)
@@ -3847,7 +3852,7 @@ static int decode_slice_header(H264Context *h){
if(!s->avctx->sample_aspect_ratio.den)
s->avctx->sample_aspect_ratio.den = 1;
- if(h->sps.timing_info_present_flag && h->sps.fixed_frame_rate_flag){
+ if(h->sps.timing_info_present_flag){
s->avctx->time_base= (AVRational){h->sps.num_units_in_tick, h->sps.time_scale};
}
}
@@ -6946,7 +6951,7 @@ static int decode_frame(AVCodecContext *avctx,
cur->reference = 1;
for(i=0; h->delayed_pic[i]; i++)
- if(h->delayed_pic[i]->key_frame)
+ if(h->delayed_pic[i]->key_frame || h->delayed_pic[i]->poc==0)
cross_idr = 1;
out = h->delayed_pic[0];