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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.cgi

Issue 2737653002: Buffer 2 seconds of data in the ffmpeg demuxer. (Closed)
Patch Set: UnmarkEndOfStream -> UnmarkEndOfStreamAndClearError Created 3 years, 9 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
« no previous file with comments | « media/filters/ffmpeg_demuxer_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/perl -wT 1 #!/usr/bin/perl -wT
2 2
3 use strict; 3 use strict;
4 4
5 use CGI; 5 use CGI;
6 use File::stat; 6 use File::stat;
7 7
8 my $query = new CGI; 8 my $query = new CGI;
9 9
10 my $name = $query->param('name'); 10 my $name = $query->param('name');
(...skipping 12 matching lines...) Expand all
23 print "Cache-Control: no-cache\n"; 23 print "Cache-Control: no-cache\n";
24 print "Content-Length: " . $filesize . "\n"; 24 print "Content-Length: " . $filesize . "\n";
25 print "Content-Type: " . $type . "\n"; 25 print "Content-Type: " . $type . "\n";
26 26
27 print "\n"; 27 print "\n";
28 28
29 open FILE, $name or die; 29 open FILE, $name or die;
30 binmode FILE; 30 binmode FILE;
31 my ($data, $n); 31 my ($data, $n);
32 my $total = 0; 32 my $total = 0;
33 my $break = $filesize / 4; 33 my $break = $filesize * 3 / 4;
34 my $string = "corrupt video"; 34 my $string = "corrupt video";
35 seek(FILE, 0, 0); 35 seek(FILE, 0, 0);
36 36
37 while (($n = read FILE, $data, 1024) != 0) { 37 while (($n = read FILE, $data, 1024) != 0) {
38 print $data; 38 print $data;
39 39
40 $total += $n; 40 $total += $n;
41 if ($total >= $filesize) { 41 if ($total >= $filesize) {
42 last; 42 last;
43 } 43 }
44 44
45 if ($total >= $break) { 45 if ($total >= $break) {
46 print $string; 46 print $string;
47 $total += length($string); 47 $total += length($string);
48 } 48 }
49 49
50 } 50 }
51 close(FILE); 51 close(FILE);
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_demuxer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698