# HG changeset patch # User bcoudurier # Date 1211250089 0 # Node ID 80a497804aa85c33ab611c283b1d5c4c57980a70 # Parent edabe3db2b6ee8cfaf9a871753696c1239df0510 demux all stsd ids if codec is the same, fix premature_mov_ending.mov, closes #451 diff -r edabe3db2b6e -r 80a497804aa8 mov.c --- a/mov.c Thu May 15 23:12:41 2008 +0000 +++ b/mov.c Tue May 20 02:21:29 2008 +0000 @@ -128,7 +128,7 @@ unsigned int bytes_per_frame; unsigned int samples_per_frame; int dv_audio_container; - int pseudo_stream_id; + int pseudo_stream_id; ///< -1 means demux all ids int16_t audio_cid; ///< stsd audio compression id unsigned drefs_count; MOV_dref_t *drefs; @@ -690,6 +690,7 @@ dref_id = get_be16(pb); if (st->codec->codec_tag && + st->codec->codec_tag != format && (c->fc->video_codec_id ? codec_get_id(codec_movvideo_tags, format) != c->fc->video_codec_id : st->codec->codec_tag != MKTAG('j','p','e','g')) ){ @@ -699,7 +700,7 @@ url_fskip(pb, size - (url_ftell(pb) - start_pos)); continue; } - sc->pseudo_stream_id= pseudo_stream_id; + sc->pseudo_stream_id = st->codec->codec_tag ? -1 : pseudo_stream_id; sc->dref_id= dref_id; st->codec->codec_tag = format; @@ -1176,7 +1177,8 @@ dprintf(mov->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", " "size %d, distance %d, keyframe %d\n", st->index, current_sample, current_offset, current_dts, sample_size, distance, keyframe); - if(sc->sample_to_chunk[stsc_index].id - 1 == sc->pseudo_stream_id) + if(sc->pseudo_stream_id == -1 || + sc->sample_to_chunk[stsc_index].id - 1 == sc->pseudo_stream_id) av_add_index_entry(st, current_offset, current_dts, sample_size, distance, keyframe ? AVINDEX_KEYFRAME : 0); current_offset += sample_size;