diff options
author | Peter Ross <pross@xvid.org> | 2014-03-30 05:42:05 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-30 18:36:47 +0400 |
commit | 92d657b5f1a40f7443abf8cdc99cdb96acb32bb3 (patch) | |
tree | dac6ad80e878e00c73fd5f436c44602c70281cf5 /libavformat/wtvenc.c | |
parent | e61973db6c0111f39f945337aba6174f1ee5e6ba (diff) |
avformat/wtvenc: advise user when H264 startcode is not present
Fixes ticket #3473.
Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/wtvenc.c')
-rw-r--r-- | libavformat/wtvenc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c index a1286ae494..f051c660ba 100644 --- a/libavformat/wtvenc.c +++ b/libavformat/wtvenc.c @@ -30,6 +30,7 @@ #include "avformat.h" #include "avio_internal.h" #include "internal.h" +#include "mpegts.h" #include "wtv.h" #define WTV_BIGSECTOR_SIZE (1 << WTV_BIGSECTOR_BITS) @@ -460,10 +461,15 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) { AVIOContext *pb = s->pb; WtvContext *wctx = s->priv_data; + AVStream *st = s->streams[pkt->stream_index]; - if (s->streams[pkt->stream_index]->codec->codec_id == AV_CODEC_ID_MJPEG && !wctx->thumbnail.size) { + if (st->codec->codec_id == AV_CODEC_ID_MJPEG && !wctx->thumbnail.size) { av_copy_packet(&wctx->thumbnail, pkt); return 0; + } else if (st->codec->codec_id == AV_CODEC_ID_H264) { + int ret = ff_check_h264_startcode(s, st, pkt); + if (ret < 0) + return ret; } /* emit sync chunk and 'timeline.table.0.entries.Event' record every 50 frames */ |