[FFmpeg-cvslog] Merge commit 'ca1e5eea0c7b72a6e30aa6488cfeced3a4853521'

Clément Bœsch git at videolan.org
Fri Mar 24 14:24:54 EET 2017


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Fri Mar 24 13:23:52 2017 +0100| [1436769c57cc6e5209609073e5fd60776a293669] | committer: Clément Bœsch

Merge commit 'ca1e5eea0c7b72a6e30aa6488cfeced3a4853521'

* commit 'ca1e5eea0c7b72a6e30aa6488cfeced3a4853521':
  Remove some pointless TRACE level debug code

Merged-by: Clément Bœsch <u at pkh.me>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1436769c57cc6e5209609073e5fd60776a293669
---

 libavformat/avidec.c  | 18 ------------------
 libavformat/ipmovie.c |  3 ---
 libavformat/mov.c     |  6 ------
 libavformat/nsvdec.c  | 15 ---------------
 4 files changed, 42 deletions(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index a7e9ab1..788a3ab 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1479,17 +1479,6 @@ resync:
 //                pkt->dts += ast->start;
             if (ast->sample_size)
                 pkt->dts /= ast->sample_size;
-            av_log(s, AV_LOG_TRACE,
-                    "dts:%"PRId64" offset:%"PRId64" %d/%d smpl_siz:%d "
-                    "base:%d st:%d size:%d\n",
-                    pkt->dts,
-                    ast->frame_offset,
-                    ast->scale,
-                    ast->rate,
-                    ast->sample_size,
-                    AV_TIME_BASE,
-                    avi->stream_index,
-                    size);
             pkt->stream_index = avi->stream_index;
 
             if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && st->index_entries) {
@@ -1760,13 +1749,6 @@ static int avi_load_index(AVFormatContext *s)
             break;
         next = avio_tell(pb) + size + (size & 1);
 
-        av_log(s, AV_LOG_TRACE, "tag=%c%c%c%c size=0x%x\n",
-                 tag        & 0xff,
-                (tag >>  8) & 0xff,
-                (tag >> 16) & 0xff,
-                (tag >> 24) & 0xff,
-                size);
-
         if (tag == MKTAG('i', 'd', 'x', '1') &&
             avi_read_idx1(s, size) >= 0) {
             avi->index_loaded=2;
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index f9ab3e0..a83909f 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -358,9 +358,6 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
                 break;
             }
             s->frame_pts_inc = ((uint64_t)AV_RL32(&scratch[0])) * AV_RL16(&scratch[4]);
-            av_log(s->avf, AV_LOG_TRACE, "  %.2f frames/second (timer div = %d, subdiv = %d)\n",
-                    1000000.0 / s->frame_pts_inc, AV_RL32(&scratch[0]),
-                    AV_RL16(&scratch[4]));
             break;
 
         case OPCODE_INIT_AUDIO_BUFFERS:
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 5b82dd6..dbe94e2 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -515,9 +515,6 @@ retry:
             }
         }
     }
-    av_log(c->fc, AV_LOG_TRACE, "lang \"%3s\" ", language);
-    av_log(c->fc, AV_LOG_TRACE, "tag \"%s\" value \"%s\" atom \"%.4s\" %d %"PRId64"\n",
-            key, str, (char*)&atom.type, str_size_alloc, atom.size);
 
     av_freep(&str);
     return 0;
@@ -597,7 +594,6 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
         dref->type = avio_rl32(pb);
         avio_rb32(pb); // version + flags
-        av_log(c->fc, AV_LOG_TRACE, "type %.4s size %d\n", (char*)&dref->type, size);
 
         if (dref->type == MKTAG('a','l','i','s') && size > 150) {
             /* macintosh alias record */
@@ -2476,7 +2472,6 @@ static int mov_read_stps(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     for (i = 0; i < entries && !pb->eof_reached; i++) {
         sc->stps_data[i] = avio_rb32(pb);
-        //av_log(c->fc, AV_LOG_TRACE, "stps %d\n", sc->stps_data[i]);
     }
 
     sc->stps_count = i;
@@ -2524,7 +2519,6 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     for (i = 0; i < entries && !pb->eof_reached; i++) {
         sc->keyframes[i] = avio_rb32(pb);
-        //av_log(c->fc, AV_LOG_TRACE, "keyframes[]=%d\n", sc->keyframes[i]);
     }
 
     sc->keyframe_count = i;
diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index eb0cf1b..ae17999 100644
--- a/libavformat/nsvdec.c
+++ b/libavformat/nsvdec.c
@@ -211,13 +211,6 @@ static const AVCodecTag nsv_codec_audio_tags[] = {
 //static int nsv_load_index(AVFormatContext *s);
 static int nsv_read_chunk(AVFormatContext *s, int fill_header);
 
-#define print_tag(str, tag, size)       \
-    av_log(NULL, AV_LOG_TRACE, "%s: tag=%c%c%c%c\n", \
-            str, tag & 0xff,            \
-            (tag >> 8) & 0xff,          \
-            (tag >> 16) & 0xff,         \
-            (tag >> 24) & 0xff);
-
 /* try to find something we recognize, and set the state accordingly */
 static int nsv_resync(AVFormatContext *s)
 {
@@ -404,8 +397,6 @@ static int nsv_parse_NSVs_header(AVFormatContext *s)
     nsv->avsync = avio_rl16(pb);
     nsv->framerate = framerate;
 
-    print_tag("NSV NSVs vtag", vtag, 0);
-    print_tag("NSV NSVs atag", atag, 0);
     av_log(s, AV_LOG_TRACE, "NSV NSVs vsize %dx%d\n", vwidth, vheight);
 
     /* XXX change to ap != NULL ? */
@@ -558,12 +549,6 @@ null_chunk_retry:
         uint32_t av_unused auxtag;
         auxsize = avio_rl16(pb);
         auxtag = avio_rl32(pb);
-        av_log(s, AV_LOG_TRACE, "NSV aux data: '%c%c%c%c', %d bytes\n",
-              (auxtag & 0x0ff),
-              ((auxtag >> 8) & 0x0ff),
-              ((auxtag >> 16) & 0x0ff),
-              ((auxtag >> 24) & 0x0ff),
-              auxsize);
         avio_skip(pb, auxsize);
         vsize -= auxsize + sizeof(uint16_t) + sizeof(uint32_t); /* that's becoming brain-dead */
     }


======================================================================

diff --cc libavformat/avidec.c
index a7e9ab1,0439c9c..788a3ab
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@@ -1479,46 -1238,19 +1479,35 @@@ resync
  //                pkt->dts += ast->start;
              if (ast->sample_size)
                  pkt->dts /= ast->sample_size;
-             av_log(s, AV_LOG_TRACE,
-                     "dts:%"PRId64" offset:%"PRId64" %d/%d smpl_siz:%d "
-                     "base:%d st:%d size:%d\n",
-                     pkt->dts,
-                     ast->frame_offset,
-                     ast->scale,
-                     ast->rate,
-                     ast->sample_size,
-                     AV_TIME_BASE,
-                     avi->stream_index,
-                     size);
              pkt->stream_index = avi->stream_index;
  
 -            if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
 +            if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && st->index_entries) {
                  AVIndexEntry *e;
                  int index;
 -                assert(st->index_entries);
  
 -                index = av_index_search_timestamp(st, ast->frame_offset, 0);
 +                index = av_index_search_timestamp(st, ast->frame_offset, AVSEEK_FLAG_ANY);
                  e     = &st->index_entries[index];
  
 -                if (index >= 0 && e->timestamp == ast->frame_offset)
 +                if (index >= 0 && e->timestamp == ast->frame_offset) {
 +                    if (index == st->nb_index_entries-1) {
 +                        int key=1;
 +                        uint32_t state=-1;
 +                        if (st->codecpar->codec_id == AV_CODEC_ID_MPEG4) {
 +                            const uint8_t *ptr = pkt->data, *end = ptr + FFMIN(size, 256);
 +                            while (ptr < end) {
 +                                ptr = avpriv_find_start_code(ptr, end, &state);
 +                                if (state == 0x1B6 && ptr < end) {
 +                                    key = !(*ptr & 0xC0);
 +                                    break;
 +                                }
 +                            }
 +                        }
 +                        if (!key)
 +                            e->flags &= ~AVINDEX_KEYFRAME;
 +                    }
                      if (e->flags & AVINDEX_KEYFRAME)
                          pkt->flags |= AV_PKT_FLAG_KEY;
 +                }
              } else {
                  pkt->flags |= AV_PKT_FLAG_KEY;
              }
@@@ -1754,32 -1438,19 +1743,25 @@@ static int avi_load_index(AVFormatConte
          goto the_end; // maybe truncated file
      av_log(s, AV_LOG_TRACE, "movi_end=0x%"PRIx64"\n", avi->movi_end);
      for (;;) {
 -        if (pb->eof_reached)
 -            break;
          tag  = avio_rl32(pb);
          size = avio_rl32(pb);
 +        if (avio_feof(pb))
 +            break;
 +        next = avio_tell(pb) + size + (size & 1);
  
-         av_log(s, AV_LOG_TRACE, "tag=%c%c%c%c size=0x%x\n",
-                  tag        & 0xff,
-                 (tag >>  8) & 0xff,
-                 (tag >> 16) & 0xff,
-                 (tag >> 24) & 0xff,
-                 size);
- 
          if (tag == MKTAG('i', 'd', 'x', '1') &&
              avi_read_idx1(s, size) >= 0) {
 +            avi->index_loaded=2;
              ret = 0;
 +        }else if (tag == MKTAG('L', 'I', 'S', 'T')) {
 +            uint32_t tag1 = avio_rl32(pb);
 +
 +            if (tag1 == MKTAG('I', 'N', 'F', 'O'))
 +                ff_read_riff_info(s, size - 4);
 +        }else if (!ret)
              break;
 -        }
  
 -        size += (size & 1);
 -        if (avio_skip(pb, size) < 0)
 +        if (avio_seek(pb, next, SEEK_SET) < 0)
              break; // something is wrong here
      }
  
diff --cc libavformat/mov.c
index 5b82dd6,34ab205..dbe94e2
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@@ -508,16 -426,7 +508,13 @@@ retry
              snprintf(key2, sizeof(key2), "%s-%s", key, language);
              av_dict_set(&c->fc->metadata, key2, str, 0);
          }
 +        if (!strcmp(key, "encoder")) {
 +            int major, minor, micro;
 +            if (sscanf(str, "HandBrake %d.%d.%d", &major, &minor, &micro) == 3) {
 +                c->handbrake_version = 1000000*major + 1000*minor + micro;
 +            }
 +        }
      }
-     av_log(c->fc, AV_LOG_TRACE, "lang \"%3s\" ", language);
-     av_log(c->fc, AV_LOG_TRACE, "tag \"%s\" value \"%s\" atom \"%.4s\" %d %"PRId64"\n",
-             key, str, (char*)&atom.type, str_size_alloc, atom.size);
  
      av_freep(&str);
      return 0;



More information about the ffmpeg-cvslog mailing list