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

Unified Diff: chromium/patches/from_upstream/36_theora_flush.patch

Issue 9290059: Initial commit of all previous Chrome build scripts. (Closed) Base URL: http://git.chromium.org/chromium/third_party/ffmpeg.git@master
Patch Set: Drop deprecated subfolder. Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chromium/patches/from_upstream/36_theora_flush.patch
diff --git a/chromium/patches/from_upstream/36_theora_flush.patch b/chromium/patches/from_upstream/36_theora_flush.patch
new file mode 100644
index 0000000000000000000000000000000000000000..849bd2c84be263f64c6794c305eb0fb49c157409
--- /dev/null
+++ b/chromium/patches/from_upstream/36_theora_flush.patch
@@ -0,0 +1,56 @@
+diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
+index c3dff7f..d853df6 100644
+--- a/libavcodec/vp3.c
++++ b/libavcodec/vp3.c
+@@ -1906,7 +1906,7 @@ static int vp3_decode_frame(AVCodecContext *avctx,
+ } else {
+ if (!s->golden_frame.data[0]) {
+ av_log(s->avctx, AV_LOG_WARNING, "vp3: first frame not a keyframe\n");
+-
++ return -1;
+ s->golden_frame.reference = 3;
+ s->golden_frame.pict_type = AV_PICTURE_TYPE_I;
+ if (ff_thread_get_buffer(avctx, &s->golden_frame) < 0) {
+@@ -2321,6 +2321,26 @@ static av_cold int theora_decode_init(AVCodecContext *avctx)
+ return vp3_decode_init(avctx);
+ }
+
++static void vp3_decode_flush(AVCodecContext *avctx)
++{
++ Vp3DecodeContext *s = avctx->priv_data;
++
++ if (s->golden_frame.data[0]) {
++ if (s->golden_frame.data[0] == s->last_frame.data[0])
++ memset(&s->last_frame, 0, sizeof(AVFrame));
++ if (s->current_frame.data[0] == s->golden_frame.data[0])
++ memset(&s->current_frame, 0, sizeof(AVFrame));
++ ff_thread_release_buffer(avctx, &s->golden_frame);
++ }
++ if (s->last_frame.data[0]) {
++ if (s->current_frame.data[0] == s->last_frame.data[0])
++ memset(&s->current_frame, 0, sizeof(AVFrame));
++ ff_thread_release_buffer(avctx, &s->last_frame);
++ }
++ if (s->current_frame.data[0])
++ ff_thread_release_buffer(avctx, &s->current_frame);
++}
++
+ AVCodec ff_theora_decoder = {
+ "theora",
+ AVMEDIA_TYPE_VIDEO,
+@@ -2332,6 +2352,7 @@ AVCodec ff_theora_decoder = {
+ vp3_decode_frame,
+ CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_FRAME_THREADS,
+ NULL,
++ .flush = vp3_decode_flush,
+ .long_name = NULL_IF_CONFIG_SMALL("Theora"),
+ .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context)
+ };
+@@ -2348,6 +2369,7 @@ AVCodec ff_vp3_decoder = {
+ vp3_decode_frame,
+ CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_FRAME_THREADS,
+ NULL,
++ .flush = vp3_decode_flush,
+ .long_name = NULL_IF_CONFIG_SMALL("On2 VP3"),
+ .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context)
+ };

Powered by Google App Engine
This is Rietveld 408576698