only print debug info when sample is actually added
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Tue, 20 May 2008 02:24:02 +0000 (02:24 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Tue, 20 May 2008 02:24:02 +0000 (02:24 +0000)
Originally committed as revision 13202 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/mov.c

index 2f7a9c7..1369839 100644 (file)
@@ -1175,13 +1175,14 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
                         stss_index++;
                 }
                 sample_size = sc->sample_size > 0 ? sc->sample_size : sc->sample_sizes[current_sample];
                         stss_index++;
                 }
                 sample_size = sc->sample_size > 0 ? sc->sample_size : sc->sample_sizes[current_sample];
-                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->pseudo_stream_id == -1 ||
                 if(sc->pseudo_stream_id == -1 ||
-                   sc->sample_to_chunk[stsc_index].id - 1 == sc->pseudo_stream_id)
+                   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);
                     av_add_index_entry(st, current_offset, current_dts, sample_size, distance,
                                     keyframe ? AVINDEX_KEYFRAME : 0);
+                    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);
+                }
                 current_offset += sample_size;
                 assert(sc->stts_data[stts_index].duration % sc->time_rate == 0);
                 current_dts += sc->stts_data[stts_index].duration / sc->time_rate;
                 current_offset += sample_size;
                 assert(sc->stts_data[stts_index].duration % sc->time_rate == 0);
                 current_dts += sc->stts_data[stts_index].duration / sc->time_rate;