[FFmpeg-cvslog] h264: Discard currently unsupported registered sei

2015-08-24 Thread John Högberg
ffmpeg | branch: master | John Högberg  | Fri Aug  7 
19:30:38 2015 +| [f9ab4fe1f7c1e9d410ca5ee2c9ff8d2892aad068] | committer: 
Luca Barbato

h264: Discard currently unsupported registered sei

Signed-off-by: Luca Barbato 

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

 libavcodec/h264_sei.c |6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index 8b07682..361d4de 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -169,6 +169,12 @@ static int 
decode_registered_user_data_closed_caption(H264Context *h, int size)
 skip_bits(&h->gb, 8);   // marker_bits
 }
 }
+} else {
+int i;
+avpriv_request_sample("Subtitles with data type 0x%02x",
+  user_data_type_code);
+for (i = 0; i < size - 1; i++)
+skip_bits(&h->gb, 8);
 }
 
 return 0;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] h264: fix AVDISCARD_NONKEY for some interlaced content

2015-07-27 Thread John Högberg
ffmpeg | branch: master | John Högberg  | Fri Jul 24 
15:30:38 2015 +0200| [b7040e67ec18259ca634a0e29d98469b3484a87c] | committer: 
Anton Khirnov

h264: fix AVDISCARD_NONKEY for some interlaced content

When skip_frame is set to _NONKEY the decoder skips everything except intra
slices, which breaks frames that consist of an intra field together with any
other field type; half the frame becomes garbage. This patch fixes the issue by
letting non-intra slices through if they're part of a keyframe.

Signed-off-by: Anton Khirnov 

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

 libavcodec/h264.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index eb4edb9..7c2b307 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1507,7 +1507,7 @@ again:
 (avctx->skip_frame < AVDISCARD_BIDIR  ||
  sl->slice_type_nos != AV_PICTURE_TYPE_B) &&
 (avctx->skip_frame < AVDISCARD_NONKEY ||
- sl->slice_type_nos == AV_PICTURE_TYPE_I) &&
+ h->cur_pic_ptr->f->key_frame) &&
 avctx->skip_frame < AVDISCARD_ALL) {
 if (avctx->hwaccel) {
 ret = avctx->hwaccel->decode_slice(avctx,

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] mpegts: Add jpeg2000 stream type

2015-06-30 Thread John Högberg
ffmpeg | branch: master | John Högberg  | Mon Jun 29 
14:57:20 2015 +0200| [42bc768e5240ec01237ad2eb7c69b917158de258] | committer: 
Luca Barbato

mpegts: Add jpeg2000 stream type

Signed-off-by: Luca Barbato 

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

 libavformat/mpegts.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 8f61f17..f96d9f0 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -583,6 +583,7 @@ static const StreamType ISO_types[] = {
 { 0x10, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_MPEG4  },
 { 0x11, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AAC_LATM   }, /* LATM syntax */
 { 0x1b, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_H264   },
+{ 0x21, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_JPEG2000   },
 { 0x24, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_HEVC   },
 { 0x42, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_CAVS   },
 { 0xd1, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_DIRAC  },

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] mpegts: Update the PSI/SI table only if the version change

2015-06-01 Thread John Högberg
ffmpeg | branch: release/2.2 | John Högberg  | Tue 
Apr 28 10:20:33 2015 +0200| [feedde4d8702d554a7f46de824a887fe4d75a714] | 
committer: Reinhard Tartler

mpegts: Update the PSI/SI table only if the version change

If a PAT is finished while a PMT section filter is opened but
not yet finished, the PMT section filter is closed and all
the received data is discarded.

This is usually not an issue but some multiplexers (With very
quick PAT/PMT repetition settings) consistently emit a PMT
section start, then a PAT, and then the rest of the PMT,
causing the aforementioned behavior to result in no PMT being
finished.

In the most pathologic situation the stream information are lost
and the probe fallback miscategorizes subtitles as mp3 audio.

Avoid the issue through eliminating redundant PSI/SI table
updates by checking their version field, which is required by
the standard to be incremented on every change no matter how
minor.

CC: libav-sta...@libav.org

Signed-off-by: Luca Barbato 
(cherry picked from commit 844201e35fe575710be8218d45828df49b77f205)
Signed-off-by: Reinhard Tartler 

Conflicts:
libavformat/mpegts.c

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

 libavformat/mpegts.c |   20 
 1 file changed, 20 insertions(+)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 3f828b4..88bef79 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -66,6 +66,7 @@ typedef void SetServiceCallback(void *opaque, int ret);
 typedef struct MpegTSSectionFilter {
 int section_index;
 int section_h_size;
+int last_ver;
 uint8_t *section_buf;
 unsigned int check_crc:1;
 unsigned int end_of_section_reached:1;
@@ -340,6 +341,8 @@ static MpegTSFilter 
*mpegts_open_section_filter(MpegTSContext *ts, unsigned int
 sec->opaque = opaque;
 sec->section_buf = av_malloc(MAX_SECTION_SIZE);
 sec->check_crc = check_crc;
+sec->last_ver = -1;
+
 if (!sec->section_buf) {
 av_free(filter);
 return NULL;
@@ -1186,6 +1189,7 @@ static int mp4_read_od(AVFormatContext *s, const uint8_t 
*buf, unsigned size,
 static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
+MpegTSSectionFilter *tssf = &filter->u.section_filter;
 SectionHeader h;
 const uint8_t *p, *p_end;
 AVIOContext pb;
@@ -1200,6 +1204,9 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_le
 return;
 if (h.tid != M4OD_TID)
 return;
+if (h.version == tssf->last_ver)
+return;
+tssf->last_ver = h.version;
 
 mp4_read_od(s, p, (unsigned)(p_end - p), mp4_descr, &mp4_descr_count, 
MAX_MP4_DESCR_COUNT);
 
@@ -1374,6 +1381,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, 
AVStream *st, int stream_type
 static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
+MpegTSSectionFilter *tssf = &filter->u.section_filter;
 SectionHeader h1, *h = &h1;
 PESContext *pes;
 AVStream *st;
@@ -1393,6 +1401,9 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 p = section;
 if (parse_section_header(h, &p, p_end) < 0)
 return;
+if (h->version == tssf->last_ver)
+return;
+tssf->last_ver = h->version;
 
 av_dlog(ts->stream, "sid=0x%x sec_num=%d/%d\n",
h->id, h->sec_num, h->last_sec_num);
@@ -1519,6 +1530,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
+MpegTSSectionFilter *tssf = &filter->u.section_filter;
 SectionHeader h1, *h = &h1;
 const uint8_t *p, *p_end;
 int sid, pmt_pid;
@@ -1532,6 +1544,9 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 return;
 if (h->tid != PAT_TID)
 return;
+if (h->version == tssf->last_ver)
+return;
+tssf->last_ver = h->version;
 
 clear_programs(ts);
 for(;;) {
@@ -1562,6 +1577,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
+MpegTSSectionFilter *tssf = &filter->u.section_filter;
 SectionHeader h1, *h = &h1;
 const uint8_t *p, *p_end, *desc_list_end, *desc_end;
 int onid, val, sid, desc_list_len, desc_tag, desc_len, service_type;
@@ -1576,6 +1592,10 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 retur

[FFmpeg-cvslog] mpegts: Update the PSI/SI table only if the version change

2015-05-19 Thread John Högberg
ffmpeg | branch: release/2.4 | John Högberg  | Tue 
Apr 28 10:20:33 2015 +0200| [844201e35fe575710be8218d45828df49b77f205] | 
committer: Vittorio Giovara

mpegts: Update the PSI/SI table only if the version change

If a PAT is finished while a PMT section filter is opened but
not yet finished, the PMT section filter is closed and all
the received data is discarded.

This is usually not an issue but some multiplexers (With very
quick PAT/PMT repetition settings) consistently emit a PMT
section start, then a PAT, and then the rest of the PMT,
causing the aforementioned behavior to result in no PMT being
finished.

In the most pathologic situation the stream information are lost
and the probe fallback miscategorizes subtitles as mp3 audio.

Avoid the issue through eliminating redundant PSI/SI table
updates by checking their version field, which is required by
the standard to be incremented on every change no matter how
minor.

CC: libav-sta...@libav.org

Signed-off-by: Luca Barbato 

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

 libavformat/mpegts.c |   20 
 1 file changed, 20 insertions(+)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index dced537..57efabd 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -73,6 +73,7 @@ typedef void SetServiceCallback (void *opaque, int ret);
 typedef struct MpegTSSectionFilter {
 int section_index;
 int section_h_size;
+int last_ver;
 uint8_t *section_buf;
 unsigned int check_crc : 1;
 unsigned int end_of_section_reached : 1;
@@ -354,6 +355,8 @@ static MpegTSFilter 
*mpegts_open_section_filter(MpegTSContext *ts,
 sec->opaque  = opaque;
 sec->section_buf = av_malloc(MAX_SECTION_SIZE);
 sec->check_crc   = check_crc;
+sec->last_ver= -1;
+
 if (!sec->section_buf) {
 av_free(filter);
 return NULL;
@@ -1234,6 +1237,7 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t 
*section,
 int section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
+MpegTSSectionFilter *tssf = &filter->u.section_filter;
 SectionHeader h;
 const uint8_t *p, *p_end;
 AVIOContext pb;
@@ -1248,6 +1252,9 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t 
*section,
 return;
 if (h.tid != M4OD_TID)
 return;
+if (h.version == tssf->last_ver)
+return;
+tssf->last_ver = h.version;
 
 mp4_read_od(s, p, (unsigned) (p_end - p), mp4_descr, &mp4_descr_count,
 MAX_MP4_DESCR_COUNT);
@@ -1433,6 +1440,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, 
AVStream *st, int stream_type
 static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
+MpegTSSectionFilter *tssf = &filter->u.section_filter;
 SectionHeader h1, *h = &h1;
 PESContext *pes;
 AVStream *st;
@@ -1452,6 +1460,9 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 p = section;
 if (parse_section_header(h, &p, p_end) < 0)
 return;
+if (h->version == tssf->last_ver)
+return;
+tssf->last_ver = h->version;
 
 av_dlog(ts->stream, "sid=0x%x sec_num=%d/%d\n",
 h->id, h->sec_num, h->last_sec_num);
@@ -1583,6 +1594,7 @@ out:
 static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
+MpegTSSectionFilter *tssf = &filter->u.section_filter;
 SectionHeader h1, *h = &h1;
 const uint8_t *p, *p_end;
 int sid, pmt_pid;
@@ -1596,6 +1608,9 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 return;
 if (h->tid != PAT_TID)
 return;
+if (h->version == tssf->last_ver)
+return;
+tssf->last_ver = h->version;
 
 clear_programs(ts);
 for (;;) {
@@ -1626,6 +1641,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
+MpegTSSectionFilter *tssf = &filter->u.section_filter;
 SectionHeader h1, *h = &h1;
 const uint8_t *p, *p_end, *desc_list_end, *desc_end;
 int onid, val, sid, desc_list_len, desc_tag, desc_len, service_type;
@@ -1640,6 +1656,10 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 return;
 if (h->tid != SDT_TID)
 return;
+if (h->version == tssf->last_ver)
+return;
+tssf->last_ver = h->version;
+
 onid = get16(&p, p_end);
 if (onid < 0)
 return;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] mpegts: Update the PSI/SI table only if the version change

2015-04-28 Thread John Högberg
ffmpeg | branch: master | John Högberg  | Tue Apr 28 
10:20:33 2015 +0200| [82de8d71118f4eafd6a43e9ea9169bd411793798] | committer: 
Luca Barbato

mpegts: Update the PSI/SI table only if the version change

If a PAT is finished while a PMT section filter is opened but
not yet finished, the PMT section filter is closed and all
the received data is discarded.

This is usually not an issue but some multiplexers (With very
quick PAT/PMT repetition settings) consistently emit a PMT
section start, then a PAT, and then the rest of the PMT,
causing the aforementioned behavior to result in no PMT being
finished.

In the most pathologic situation the stream information are lost
and the probe fallback miscategorizes subtitles as mp3 audio.

Avoid the issue through eliminating redundant PSI/SI table
updates by checking their version field, which is required by
the standard to be incremented on every change no matter how
minor.

CC: libav-sta...@libav.org

Signed-off-by: Luca Barbato 

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

 libavformat/mpegts.c |   20 
 1 file changed, 20 insertions(+)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index ae9d1f4..8f61f17 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -73,6 +73,7 @@ typedef void SetServiceCallback (void *opaque, int ret);
 typedef struct MpegTSSectionFilter {
 int section_index;
 int section_h_size;
+int last_ver;
 uint8_t *section_buf;
 unsigned int check_crc : 1;
 unsigned int end_of_section_reached : 1;
@@ -372,6 +373,8 @@ static MpegTSFilter 
*mpegts_open_section_filter(MpegTSContext *ts,
 sec->opaque  = opaque;
 sec->section_buf = av_malloc(MAX_SECTION_SIZE);
 sec->check_crc   = check_crc;
+sec->last_ver= -1;
+
 if (!sec->section_buf) {
 av_free(filter);
 return NULL;
@@ -1255,6 +1258,7 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t 
*section,
 int section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
+MpegTSSectionFilter *tssf = &filter->u.section_filter;
 SectionHeader h;
 const uint8_t *p, *p_end;
 AVIOContext pb;
@@ -1269,6 +1273,9 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t 
*section,
 return;
 if (h.tid != M4OD_TID)
 return;
+if (h.version == tssf->last_ver)
+return;
+tssf->last_ver = h.version;
 
 mp4_read_od(s, p, (unsigned) (p_end - p), mp4_descr, &mp4_descr_count,
 MAX_MP4_DESCR_COUNT);
@@ -1507,6 +1514,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, 
AVStream *st, int stream_type
 static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
+MpegTSSectionFilter *tssf = &filter->u.section_filter;
 SectionHeader h1, *h = &h1;
 PESContext *pes;
 AVStream *st;
@@ -1526,6 +1534,9 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 p = section;
 if (parse_section_header(h, &p, p_end) < 0)
 return;
+if (h->version == tssf->last_ver)
+return;
+tssf->last_ver = h->version;
 
 av_log(ts->stream, AV_LOG_TRACE, "sid=0x%x sec_num=%d/%d\n",
 h->id, h->sec_num, h->last_sec_num);
@@ -1657,6 +1668,7 @@ out:
 static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
+MpegTSSectionFilter *tssf = &filter->u.section_filter;
 SectionHeader h1, *h = &h1;
 const uint8_t *p, *p_end;
 int sid, pmt_pid;
@@ -1670,6 +1682,9 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 return;
 if (h->tid != PAT_TID)
 return;
+if (h->version == tssf->last_ver)
+return;
+tssf->last_ver = h->version;
 
 clear_programs(ts);
 for (;;) {
@@ -1700,6 +1715,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
+MpegTSSectionFilter *tssf = &filter->u.section_filter;
 SectionHeader h1, *h = &h1;
 const uint8_t *p, *p_end, *desc_list_end, *desc_end;
 int onid, val, sid, desc_list_len, desc_tag, desc_len, service_type;
@@ -1714,6 +1730,10 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 return;
 if (h->tid != SDT_TID)
 return;
+if (h->version == tssf->last_ver)
+return;
+tssf->last_ver = h->version;
+
 onid = get16(&p, p_end);
 if (onid < 0)
 return;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog