aboutsummaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer2012-04-14 21:49:01 +0200
committerMichael Niedermayer2012-04-14 22:37:43 +0200
commit7432bcfe5a36331502c49fe03aefe39b9936247a (patch)
tree398b1874abbd4bcf7c103738ac4548e830af0a43 /libavformat
parent01bf2ad7351fdaa2e21b6bdf963d22d6ffccb920 (diff)
parent7bf9e3391fa21d90ff283fc03a12287fe73db9e8 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: vsrc_buffer: fix check from 7ae7c41. libxvid: Reorder functions to avoid forward declarations; make functions static. libxvid: drop some pointless dead code wmal: vertical alignment cosmetics wmal: Warn about missing bitstream splicing feature and ask for sample. wmal: Skip seekable_frame_in_packet. wmal: Drop unused variable num_possible_block_size. avfiltergraph: make the AVFilterInOut alloc/free API public graphparser: allow specifying sws flags in the graph description. graphparser: fix the order of connecting unlabeled links. graphparser: add avfilter_graph_parse2(). vsrc_buffer: allow using a NULL buffer to signal EOF. swscale: handle last pixel if lines have an odd width. qdm2: fix a dubious pointer cast WMAL: Do not try to read rawpcm coefficients if bits is invalid mov: Fix detecting there is no sync sample. tiffdec: K&R cosmetics avf: has_duration does not check the global one dsputil: fix optimized emu_edge function on Win64. Conflicts: doc/APIchanges libavcodec/libxvid_rc.c libavcodec/libxvidff.c libavcodec/tiff.c libavcodec/wmalosslessdec.c libavfilter/avfiltergraph.h libavfilter/graphparser.c libavfilter/version.h libavfilter/vsrc_buffer.c libswscale/output.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/isom.h1
-rw-r--r--libavformat/mov.c5
-rw-r--r--libavformat/utils.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/isom.h b/libavformat/isom.h
index f5d03b20eb..542b76bf30 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -107,6 +107,7 @@ typedef struct MOVStreamContext {
unsigned int alt_sample_size; ///< always contains sample size from stsz atom
unsigned int sample_count;
int *sample_sizes;
+ int keyframe_absent;
unsigned int keyframe_count;
int *keyframes;
int time_scale;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 234c1f5ce1..f7ae19ab9f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1618,7 +1618,10 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_dlog(c->fc, "keyframe_count = %d\n", entries);
if (!entries)
+ {
+ sc->keyframe_absent = 1;
return 0;
+ }
if (entries >= UINT_MAX / sizeof(int))
return AVERROR_INVALIDDATA;
sc->keyframes = av_malloc(entries * sizeof(int));
@@ -1873,7 +1876,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
return;
}
- if (!sc->keyframe_count || current_sample+key_off == sc->keyframes[stss_index]) {
+ if (!sc->keyframe_absent && (!sc->keyframe_count || current_sample+key_off == sc->keyframes[stss_index])) {
keyframe = 1;
if (stss_index + 1 < sc->keyframe_count)
stss_index++;
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 875d0d84a8..3c3ced75a0 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1975,6 +1975,8 @@ static int has_duration(AVFormatContext *ic)
if (st->duration != AV_NOPTS_VALUE)
return 1;
}
+ if (ic->duration)
+ return 1;
return 0;
}