OSDN Git Service

Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 2 Aug 2011 20:07:51 +0000 (22:07 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 2 Aug 2011 20:12:18 +0000 (22:12 +0200)
* qatar/master:
  Revert "swscale: use 15-bit intermediates for 9/10-bit scaling."
  swscale: use 15-bit intermediates for 9/10-bit scaling.
  dct32: Add SSE2 ASM optimizations
  Correct chroma vector calculation for RealVideo 3.
  lavf: Add an option to discard corrupted frames
  mpegts: Mark wrongly-sized packets as corrupted
  mpegts: Move scan test to handle_packets
  mpegts: Mark corrupted packets
  mpegts: Reset continuity counter on seek
  mpegts: Fix for continuity counter
  mpegts: Silence "can't seek" warning on unseekable
  apichange: add an entry for AV_PKT_FLAG_CORRUPT
  avpacket: signal possibly corrupted packets
  mpeg4videodec: remove dead code that would have detected erroneous encoding
  aac: Remove some suspicious illegal memcpy()s from LTP.
  bink: Eliminate unnecessary shadow declaration.

Conflicts:
doc/APIchanges
libavcodec/version.h
libavformat/avformat.h
libavformat/options.c
libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
13 files changed:
1  2 
doc/APIchanges
libavcodec/aacdec.c
libavcodec/avcodec.h
libavcodec/bink.c
libavcodec/rv34.c
libavcodec/version.h
libavcodec/x86/dct32_sse.asm
libavcodec/x86/fft.c
libavcodec/x86/fft.h
libavformat/avformat.h
libavformat/mpegts.c
libavformat/options.c
libavformat/utils.c

diff --cc doc/APIchanges
@@@ -13,14 -13,9 +13,17 @@@ libavutil:   2011-04-1
  
  API changes, most recent first:
  
+ 2011-08-02 - 9d39cbf - lavc 53.7.1
+   Add AV_PKT_FLAG_CORRUPT AVPacket flag.
 +2011-07-16 - xxxxxx - lavfi 2.27.0
 +  Add audio packing negotiation fields and helper functions.
 +
 +  In particular, add AVFilterPacking enum, planar, in_packings and
 +  out_packings fields to AVFilterLink, and the functions:
 +  avfilter_set_common_packing_formats()
 +  avfilter_all_packing_formats()
 +
  2011-07-10 - a67c061 - lavf 53.3.0
    Add avformat_find_stream_info(), deprecate av_find_stream_info().
  
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -21,8 -21,8 +21,8 @@@
  #define AVCODEC_VERSION_H
  
  #define LIBAVCODEC_VERSION_MAJOR 53
 -#define LIBAVCODEC_VERSION_MINOR  7
 +#define LIBAVCODEC_VERSION_MINOR  9
- #define LIBAVCODEC_VERSION_MICRO  0
+ #define LIBAVCODEC_VERSION_MICRO  1
  
  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                 LIBAVCODEC_VERSION_MINOR, \
Simple merge
Simple merge
Simple merge
@@@ -774,10 -750,7 +774,11 @@@ typedef struct AVFormatContext 
  #define AVFMT_FLAG_RTP_HINT     0x0040 ///< Deprecated, use the -movflags rtphint muxer specific AVOption instead
  #endif
  #define AVFMT_FLAG_CUSTOM_IO    0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it.
+ #define AVFMT_FLAG_DISCARD_CORRUPT  0x0100 ///< Discard frames marked corrupted
 +#define AVFMT_FLAG_MP4A_LATM    0x8000 ///< Enable RTP MP4A-LATM payload
 +#define AVFMT_FLAG_SORT_DTS    0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
 +#define AVFMT_FLAG_PRIV_OPT    0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted)
 +#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Dont merge side data but keep it seperate.
  
  #if FF_API_LOOP_INPUT
      /**
@@@ -1399,7 -1404,22 +1425,22 @@@ static int handle_packets(MpegTSContex
  {
      AVFormatContext *s = ts->stream;
      uint8_t packet[TS_PACKET_SIZE];
-     int packet_num, ret;
+     int packet_num, ret = 0;
+     if (avio_tell(s->pb) != ts->last_pos) {
+         int i;
 -        av_dlog("Skipping after seek\n");
++//        av_dlog("Skipping after seek\n");
+         /* seek detected, flush pes buffer */
+         for (i = 0; i < NB_PID_MAX; i++) {
+             if (ts->pids[i] && ts->pids[i]->type == MPEGTS_PES) {
+                 PESContext *pes = ts->pids[i]->u.pes_filter.opaque;
+                 av_freep(&pes->buffer);
+                 ts->pids[i]->last_cc = -1;
+                 pes->data_index = 0;
+                 pes->state = MPEGTS_SKIP; /* skip until pes header */
+             }
+         }
+     }
  
      ts->stop_parse = 0;
      packet_num = 0;
@@@ -79,9 -79,7 +79,10 @@@ static const AVOption options[]=
  #if FF_API_FLAG_RTP_HINT
  {"rtphint", "add rtp hinting (deprecated, use the -movflags rtphint option instead)", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_RTP_HINT }, INT_MIN, INT_MAX, E, "fflags"},
  #endif
+ {"discardcorrupt", "discard corrupted frames", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_DISCARD_CORRUPT }, INT_MIN, INT_MAX, D, "fflags"},
 +{"sortdts", "try to interleave outputted packets by dts", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_SORT_DTS }, INT_MIN, INT_MAX, D, "fflags"},
 +{"keepside", "dont merge side data", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_KEEP_SIDE_DATA }, INT_MIN, INT_MAX, D, "fflags"},
 +{"latm", "enable RTP MP4A-LATM payload", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_MP4A_LATM }, INT_MIN, INT_MAX, E, "fflags"},
  {"analyzeduration", "how many microseconds are analyzed to estimate duration", OFFSET(max_analyze_duration), FF_OPT_TYPE_INT, {.dbl = 5*AV_TIME_BASE }, 0, INT_MAX, D},
  {"cryptokey", "decryption key", OFFSET(key), FF_OPT_TYPE_BINARY, {.dbl = 0}, 0, 0, D},
  {"indexmem", "max memory used for timestamp index (per stream)", OFFSET(max_index_size), FF_OPT_TYPE_INT, {.dbl = 1<<20 }, 0, INT_MAX, D},
@@@ -738,8 -720,14 +738,17 @@@ int av_read_packet(AVFormatContext *s, 
              continue;
          }
  
+         if ((s->flags & AVFMT_FLAG_DISCARD_CORRUPT) &&
+             (pkt->flags & AV_PKT_FLAG_CORRUPT)) {
+             av_log(s, AV_LOG_WARNING,
+                    "Dropped corrupted packet (stream = %d)\n",
+                    pkt->stream_index);
+             continue;
+         }
 +        if(!(s->flags & AVFMT_FLAG_KEEP_SIDE_DATA))
 +            av_packet_merge_side_data(pkt);
++
          st= s->streams[pkt->stream_index];
  
          switch(st->codec->codec_type){