Mercurial > libavformat.hg
comparison mov.c @ 1092:3252d6419540 libavformat
fix keyframe check, stss might be there but count set to 0
author | bcoudurier |
---|---|
date | Thu, 18 May 2006 15:17:09 +0000 |
parents | 4c7e75e255f8 |
children | 04f092701779 |
comparison
equal
deleted
inserted
replaced
1091:6207034ac05b | 1092:3252d6419540 |
---|---|
1865 av_get_packet(&s->pb, pkt, size); | 1865 av_get_packet(&s->pb, pkt, size); |
1866 pkt->stream_index = sc->ffindex; | 1866 pkt->stream_index = sc->ffindex; |
1867 | 1867 |
1868 // If the keyframes table exists, mark any samples that are in the table as key frames. | 1868 // If the keyframes table exists, mark any samples that are in the table as key frames. |
1869 // If no table exists, treat very sample as a key frame. | 1869 // If no table exists, treat very sample as a key frame. |
1870 if (sc->keyframes) { | 1870 if (sc->keyframe_count) { |
1871 a = 0; | 1871 a = 0; |
1872 b = sc->keyframe_count - 1; | 1872 b = sc->keyframe_count - 1; |
1873 | 1873 |
1874 while (a < b) { | 1874 while (a < b) { |
1875 m = (a + b + 1) >> 1; | 1875 m = (a + b + 1) >> 1; |
2008 av_log(s, AV_LOG_ERROR, "mov: sample pos is too high, unable to seek (req. sample=%i, sample count=%ld)\n", sample, sc->sample_count); | 2008 av_log(s, AV_LOG_ERROR, "mov: sample pos is too high, unable to seek (req. sample=%i, sample count=%ld)\n", sample, sc->sample_count); |
2009 return -1; | 2009 return -1; |
2010 } | 2010 } |
2011 | 2011 |
2012 // Step 3. Find the prior sync. sample using the Sync sample atom (stss) | 2012 // Step 3. Find the prior sync. sample using the Sync sample atom (stss) |
2013 if (sc->keyframes) { | 2013 if (sc->keyframe_count) { |
2014 a = 0; | 2014 a = 0; |
2015 b = sc->keyframe_count - 1; | 2015 b = sc->keyframe_count - 1; |
2016 while (a < b) { | 2016 while (a < b) { |
2017 m = (a + b + 1) >> 1; | 2017 m = (a + b + 1) >> 1; |
2018 if (sc->keyframes[m] > sample) { | 2018 if (sc->keyframes[m] > sample) { |