Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: patches/to_upstream/12_vp3_key_frame_after_flush.patch

Issue 2850032: ffmpeg update to june 23 version which fixes mp4 crash on still frames with 3... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/ffmpeg/
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 diff -rpu -N orig/libavcodec/vp3.c ffmpeg-mt/libavcodec/vp3.c
2 --- orig/libavcodec/vp3.c 2010-06-17 09:40:08.794413800 -0700
3 +++ ffmpeg-mt/libavcodec/vp3.c 2010-06-17 09:40:12.475781900 -0700
4 @@ -134,6 +134,7 @@ typedef struct Vp3DecodeContext {
5 AVFrame last_frame;
6 AVFrame current_frame;
7 int keyframe;
8 + int flushed;
9 DSPContext dsp;
10 int flipped_image;
11 int last_slice_end;
12 @@ -1608,6 +1609,7 @@ static av_cold int vp3_decode_init(AVCod
13 s->avctx = avctx;
14 s->width = FFALIGN(avctx->width, 16);
15 s->height = FFALIGN(avctx->height, 16);
16 + s->flushed = 0;
17 if (avctx->pix_fmt == PIX_FMT_NONE)
18 avctx->pix_fmt = PIX_FMT_YUV420P;
19 avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
20 @@ -1891,7 +1893,7 @@ static int vp3_decode_frame(AVCodecConte
21 if (s->qps[i] != s->last_qps[i] || s->qps[0] != s->last_qps[0])
22 init_dequantizer(s, i);
23
24 - if (avctx->skip_frame >= AVDISCARD_NONKEY && !s->keyframe)
25 + if (!s->keyframe && (avctx->skip_frame >= AVDISCARD_NONKEY || s->flushed))
26 return buf_size;
27
28 s->current_frame.reference = 3;
29 @@ -1902,6 +1904,7 @@ static int vp3_decode_frame(AVCodecConte
30 }
31
32 if (s->keyframe) {
33 + s->flushed = 0;
34 if (!s->theora)
35 {
36 skip_bits(&gb, 4); /* width code */
37 @@ -2040,6 +2043,12 @@ static av_cold int vp3_decode_end(AVCode
38 return 0;
39 }
40
41 +static void vp3_decode_flush (AVCodecContext *avctx) {
42 + // FIXME: Actually flush data.
43 + Vp3DecodeContext *s = avctx->priv_data;
44 + s->flushed = 1;
45 +}
46 +
47 static int read_huffman_tree(AVCodecContext *avctx, GetBitContext *gb)
48 {
49 Vp3DecodeContext *s = avctx->priv_data;
50 @@ -2346,6 +2355,7 @@ AVCodec theora_decoder = {
51 vp3_decode_frame,
52 CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_FRAME_THREADS,
53 NULL,
54 + .flush = vp3_decode_flush,
55 .long_name = NULL_IF_CONFIG_SMALL("Theora"),
56 .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context)
57 };
58 @@ -2362,6 +2372,7 @@ AVCodec vp3_decoder = {
59 vp3_decode_frame,
60 CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_FRAME_THREADS,
61 NULL,
62 + .flush = vp3_decode_flush,
63 .long_name = NULL_IF_CONFIG_SMALL("On2 VP3"),
64 .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context)
65 };
OLDNEW
« no previous file with comments | « patches/to_upstream/11_mkv_buffer_overflow.patch ('k') | patches/to_upstream/15_mkv_buffer_overflow.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698