Merge lp:~phablet-team/media-hub/fix-1546963 into lp:media-hub

Proposed by Jim Hodapp
Status: Merged
Approved by: Lorn Potter
Approved revision: 177
Merged at revision: 174
Proposed branch: lp:~phablet-team/media-hub/fix-1546963
Merge into: lp:media-hub
Diff against target: 39 lines (+12/-10)
1 file modified
src/core/media/gstreamer/playbin.cpp (+12/-10)
To merge this branch: bzr merge lp:~phablet-team/media-hub/fix-1546963
Reviewer Review Type Date Requested Status
Alfonso Sanchez-Beato Approve
Konrad Zapałowicz (community) Approve
PS Jenkins bot continuous-integration Approve
Simon Fels Approve
Review via email: mp+288174@code.launchpad.net

Commit message

Only call encode_uri() for local files, pass everything else straight through unmodified.

Description of the change

Only call encode_uri() for local files, pass everything else straight through unmodified.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Simon Fels (morphis) wrote :

LGTM

review: Approve
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Small not, see inline comment.

review: Needs Fixing
175. By Jim Hodapp

Address review comment

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
176. By Jim Hodapp

Address last review comment

177. By Jim Hodapp

One more fix

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Konrad Zapałowicz (kzapalowicz) :
review: Approve
178. By Jim Hodapp

Add a comment as to why we first decode a URI before encoding it

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/core/media/gstreamer/playbin.cpp'
2--- src/core/media/gstreamer/playbin.cpp 2016-02-22 18:34:11 +0000
3+++ src/core/media/gstreamer/playbin.cpp 2016-03-07 21:05:50 +0000
4@@ -467,23 +467,25 @@
5 if (current_uri and do_pipeline_reset)
6 reset_pipeline();
7
8- std::string encoded_uri;
9+ std::string tmp_uri{uri};
10 media::UriCheck::Ptr uri_check{std::make_shared<media::UriCheck>(uri)};
11- if (uri_check->is_encoded())
12+ if (uri_check->is_local_file())
13 {
14- encoded_uri = decode_uri(uri);
15+ if (uri_check->is_encoded())
16+ {
17+ // First decode the URI just in case it's partially encoded already
18+ tmp_uri = decode_uri(uri);
19 #ifdef VERBOSE_DEBUG
20- std::cout << "File URI was encoded, now decoded: " << encoded_uri << std::endl;
21+ std::cout << "File URI was encoded, now decoded: " << tmp_uri << std::endl;
22 #endif
23- encoded_uri = encode_uri(encoded_uri);
24+ }
25+ tmp_uri = encode_uri(tmp_uri);
26 }
27- else
28- encoded_uri = encode_uri(uri);
29
30- g_object_set(pipeline, "uri", encoded_uri.c_str(), NULL);
31- if (is_video_file(encoded_uri))
32+ g_object_set(pipeline, "uri", tmp_uri.c_str(), NULL);
33+ if (is_video_file(tmp_uri))
34 file_type = MEDIA_FILE_TYPE_VIDEO;
35- else if (is_audio_file(encoded_uri))
36+ else if (is_audio_file(tmp_uri))
37 file_type = MEDIA_FILE_TYPE_AUDIO;
38
39 request_headers = headers;

Subscribers

People subscribed via source and target branches

to all changes: