Merge commit '374fdc8c071dcd96422378b0a1a0d453336d8a01'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 24 Apr 2014 19:27:09 +0000 (21:27 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 24 Apr 2014 19:27:09 +0000 (21:27 +0200)
* commit '374fdc8c071dcd96422378b0a1a0d453336d8a01':
  flv: Improve log messages

Conflicts:
libavformat/flvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/flvdec.c

@@@ -804,24 -787,20 +804,24 @@@ static int flv_read_packet(AVFormatCont
              flags    = avio_r8(s->pb);
              size--;
          } else if (type == FLV_TAG_TYPE_VIDEO) {
 -            is_audio = 0;
 +            stream_type = FLV_STREAM_TYPE_VIDEO;
              flags    = avio_r8(s->pb);
              size--;
 -            if ((flags & 0xf0) == 0x50) /* video info / command frame */
 +            if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_VIDEO_INFO_CMD)
                  goto skip;
 +        } else if (type == FLV_TAG_TYPE_META) {
 +            stream_type=FLV_STREAM_TYPE_DATA;
 +            if (size > 13 + 1 + 4 && dts == 0) { // Header-type metadata stuff
 +                meta_pos = avio_tell(s->pb);
 +                if (flv_read_metabody(s, next) == 0) {
 +                    goto skip;
 +                }
 +                avio_seek(s->pb, meta_pos, SEEK_SET);
 +            }
          } else {
 -            if (type == FLV_TAG_TYPE_META && size > 13 + 1 + 4)
 -                if (flv_read_metabody(s, next) > 0) {
 -                    return flv_data_packet(s, pkt, dts, next);
 -                } else /* skip packet */
 -                    av_log(s, AV_LOG_DEBUG,
 -                           "Skipping flv packet: type %d, size %d, flags %d.\n",
 -                           type, size, flags);
 -
 +            av_log(s, AV_LOG_DEBUG,
-                    "skipping flv packet: type %d, size %d, flags %d\n",
++                   "Skipping flv packet: type %d, size %d, flags %d.\n",
 +                   type, size, flags);
  skip:
              avio_seek(s->pb, next, SEEK_SET);
              continue;
@@@ -937,11 -899,7 +937,11 @@@ retry_duration
              if (cts < 0) { // dts are wrong
                  flv->wrong_dts = 1;
                  av_log(s, AV_LOG_WARNING,
-                        "negative cts, previous timestamps might be wrong\n");
+                        "Negative cts, previous timestamps might be wrong.\n");
 +            } else if (FFABS(dts - pts) > 1000*60*15) {
 +                av_log(s, AV_LOG_WARNING,
 +                       "invalid timestamps %"PRId64" %"PRId64"\n", dts, pts);
 +                dts = pts = AV_NOPTS_VALUE;
              }
              if (flv->wrong_dts)
                  dts = AV_NOPTS_VALUE;