Merge lp:~lorn-potter/media-hub/1420728 into lp:media-hub

Proposed by Lorn Potter
Status: Merged
Approved by: Jim Hodapp
Approved revision: 190
Merged at revision: 192
Proposed branch: lp:~lorn-potter/media-hub/1420728
Merge into: lp:media-hub
Diff against target: 33 lines (+21/-2)
1 file modified
src/core/media/gstreamer/playbin.cpp (+21/-2)
To merge this branch: bzr merge lp:~lorn-potter/media-hub/1420728
Reviewer Review Type Date Requested Status
Jim Hodapp (community) code Approve
Review via email: mp+297707@code.launchpad.net

Commit message

Add support for files with no filename extension.

Description of the change

Add support for files with no filename extension.

To post a comment you must log in.
Revision history for this message
Jim Hodapp (jhodapp) wrote :

One simple change.

review: Needs Fixing
Revision history for this message
Lorn Potter (lorn-potter) :
Revision history for this message
Jim Hodapp (jhodapp) wrote :

Yes missed that, apparently I shouldn't review late at night. ;)

review: Approve (code)

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-06-16 20:19:35 +0000
+++ src/core/media/gstreamer/playbin.cpp 2016-06-16 22:43:50 +0000
@@ -639,8 +639,27 @@
639 if (!info)639 if (!info)
640 return std::string();640 return std::string();
641641
642 return std::string(g_file_info_get_attribute_string(642 std::string content_type = g_file_info_get_attribute_string(
643 info.get(), G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE));643 info.get(), G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE);
644 if (content_type.empty())
645 return std::string();
646
647 if (content_type == "application/octet-stream")
648 {
649 std::unique_ptr<GFileInfo, void(*)(void *)> full_info(
650 g_file_query_info(file.get(), G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
651 G_FILE_QUERY_INFO_NONE,
652 /* cancellable */ NULL, &error),g_object_unref);
653
654 if (!full_info)
655 return std::string();
656
657 content_type = g_file_info_get_attribute_string(
658 full_info.get(), G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
659 if (content_type.empty())
660 return std::string();
661 }
662 return content_type;
644}663}
645664
646std::string gstreamer::Playbin::encode_uri(const std::string& uri) const665std::string gstreamer::Playbin::encode_uri(const std::string& uri) const

Subscribers

People subscribed via source and target branches