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
=== modified file 'src/core/media/gstreamer/playbin.cpp'
--- src/core/media/gstreamer/playbin.cpp 2016-02-22 18:34:11 +0000
+++ src/core/media/gstreamer/playbin.cpp 2016-03-07 21:05:50 +0000
@@ -467,23 +467,25 @@
467 if (current_uri and do_pipeline_reset)467 if (current_uri and do_pipeline_reset)
468 reset_pipeline();468 reset_pipeline();
469469
470 std::string encoded_uri;470 std::string tmp_uri{uri};
471 media::UriCheck::Ptr uri_check{std::make_shared<media::UriCheck>(uri)};471 media::UriCheck::Ptr uri_check{std::make_shared<media::UriCheck>(uri)};
472 if (uri_check->is_encoded())472 if (uri_check->is_local_file())
473 {473 {
474 encoded_uri = decode_uri(uri);474 if (uri_check->is_encoded())
475 {
476 // First decode the URI just in case it's partially encoded already
477 tmp_uri = decode_uri(uri);
475#ifdef VERBOSE_DEBUG478#ifdef VERBOSE_DEBUG
476 std::cout << "File URI was encoded, now decoded: " << encoded_uri << std::endl;479 std::cout << "File URI was encoded, now decoded: " << tmp_uri << std::endl;
477#endif480#endif
478 encoded_uri = encode_uri(encoded_uri);481 }
482 tmp_uri = encode_uri(tmp_uri);
479 }483 }
480 else
481 encoded_uri = encode_uri(uri);
482484
483 g_object_set(pipeline, "uri", encoded_uri.c_str(), NULL);485 g_object_set(pipeline, "uri", tmp_uri.c_str(), NULL);
484 if (is_video_file(encoded_uri))486 if (is_video_file(tmp_uri))
485 file_type = MEDIA_FILE_TYPE_VIDEO;487 file_type = MEDIA_FILE_TYPE_VIDEO;
486 else if (is_audio_file(encoded_uri))488 else if (is_audio_file(tmp_uri))
487 file_type = MEDIA_FILE_TYPE_AUDIO;489 file_type = MEDIA_FILE_TYPE_AUDIO;
488490
489 request_headers = headers;491 request_headers = headers;

Subscribers

People subscribed via source and target branches

to all changes: