Merge lp://qastaging/~d.filoni/media-hub/improve_content_type_recognition into lp://qastaging/media-hub

Proposed by Devid Antonio Filoni
Status: Needs review
Proposed branch: lp://qastaging/~d.filoni/media-hub/improve_content_type_recognition
Merge into: lp://qastaging/media-hub
Diff against target: 29 lines (+19/-1)
1 file modified
src/core/media/gstreamer/playbin.cpp (+19/-1)
To merge this branch: bzr merge lp://qastaging/~d.filoni/media-hub/improve_content_type_recognition
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+310339@code.qastaging.launchpad.net

Description of the change

file_info_from_uri (gstreamer/playbin.cpp) cannot recognize content type of remote files. When the content type is not recognized "audio/video/" is returned as content type, however, as is_video_file function searches for a content type starting with "video/", a video is never recognized and only the audio is played as described in bug #1446260 (is_video_file always returns false and is_audio_file returns true so MEDIA_FILE_TYPE_AUDIO is set as file_type)
Proposed branch calls g_content_type_guess on filename in order to try to find content type parsing file extension only when a content type was not found by file_info_from_uri. This branch is not a real fix for bug #1446260, the real solution would be to parse content type from remote files, however it helps to recognize many video files (like the one in bug description).
In order to avoid regressions, g_content_type_guess output is considered valid only if a "video/" content type is recognized, otherwise it will fails to "audio/video/".

What I tested on mako:
- local files (video)
- bug #1446260 : mediaplayer-app http://wbads.vo.llnwd.net/o25/u/telepixtv/videos/ellen/20150320/594/0_fu4qgsy7_0_obx408yq_2.mp4 --desktop_file_hint=/usr/share/applications/mediaplayer-app.desktop
- uradio
Everything works fine.

To post a comment you must log in.

Unmerged revisions

212. By Devid Antonio Filoni

Improve gstreamer playbin get_file_content_type using g_content_type_guess as fallback when no content type is found by file_info_from_uri

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches