{"action":"created","comment":{"url":"https://api.github.com/repos/sdroege/gst-player/pulls/comments/28645729","id":28645729,"diff_hunk":"@@ -1121,6 +1144,458 @@ element_cb (GstBus * bus, GstMessage * msg, gpointer user_data)\n   }\n }\n \n+static void\n+player_set_flag (GstPlayer *self, gint pos)\n+{\n+  gint flags;\n+\n+  g_object_get (self->priv->playbin, \"flags\", &flags, NULL);\n+  flags |= pos;\n+  g_object_set (self->priv->playbin, \"flags\", &flags, NULL);\n+}\n+\n+static void\n+player_clear_flag (GstPlayer *self, gint pos)\n+{\n+  gint flags;\n+\n+  g_object_get (self->priv->playbin, \"flags\", &flags, NULL);\n+  flags &= ~pos;\n+  g_object_set (self->priv->playbin, \"flags\", &flags, NULL);\n+}\n+\n+static gboolean\n+is_track_enabled (GstPlayer *self, gint pos)\n+{\n+  gint flags;\n+\n+  g_object_get (self->priv->playbin, \"flags\", &flags, NULL);\n+  if (flags & pos)\n+    return TRUE;\n+\n+  return FALSE;\n+}\n+\n+typedef struct\n+{\n+  GstPlayer *player;\n+  GstPlayerMediaInfo  *info;\n+  guint signal;\n+}MediaInfoUpdatedSignalData;\n+\n+static gboolean\n+media_info_updated_dispatch (gpointer user_data)\n+{\n+  MediaInfoUpdatedSignalData  *data = user_data;\n+\n+  g_signal_emit (data->player, signals[data->signal], 0, data->info);\n+\n+  return FALSE;\n+}\n+\n+static void\n+free_media_info_updated_signal_data (MediaInfoUpdatedSignalData *data)\n+{\n+  g_slice_free (MediaInfoUpdatedSignalData, data);\n+}\n+\n+static void\n+emit_media_updated_signal (GstPlayer *self, GstPlayerMediaInfo *info,\n+  guint signal)\n+{\n+  if (self->priv->dispatch_to_main_context) {\n+    MediaInfoUpdatedSignalData *data = g_slice_new\n+                                        (MediaInfoUpdatedSignalData);\n+\n+    /* unref the previous media info object */\n+    if (self->priv->prev_media_info)\n+      g_object_unref (self->priv->prev_media_info);\n+    self->priv->prev_media_info = self->priv->media_info;\n+    self->priv->media_info = info;\n+\n+    data->player = self;\n+    data->info   = self->priv->media_info;\n+    data->signal = signal;\n+\n+    g_main_context_invoke_full (self->priv->application_context,\n+                    G_PRIORITY_DEFAULT,\n+                    media_info_updated_dispatch,\n+                    data,\n+                    (GDestroyNotify) free_media_info_updated_signal_data);\n+  } else {\n+    g_signal_emit (self, signals[signal], 0);","path":"lib/gst/player/gstplayer.c","position":147,"original_position":147,"commit_id":"d8a5a36c89611f7b50554c1488ec8986deb58af3","original_commit_id":"d8a5a36c89611f7b50554c1488ec8986deb58af3","user":{"login":"sdroege","id":301846,"avatar_url":"https://avatars.githubusercontent.com/u/301846?v=3","gravatar_id":"","url":"https://api.github.com/users/sdroege","html_url":"https://github.com/sdroege","followers_url":"https://api.github.com/users/sdroege/followers","following_url":"https://api.github.com/users/sdroege/following{/other_user}","gists_url":"https://api.github.com/users/sdroege/gists{/gist_id}","starred_url":"https://api.github.com/users/sdroege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdroege/subscriptions","organizations_url":"https://api.github.com/users/sdroege/orgs","repos_url":"https://api.github.com/users/sdroege/repos","events_url":"https://api.github.com/users/sdroege/events{/privacy}","received_events_url":"https://api.github.com/users/sdroege/received_events","type":"User","site_admin":false},"body":"In this case you're emitting the signal without the actual media info, and also you don't update self->priv->media_info","created_at":"2015-04-18T17:14:12Z","updated_at":"2015-04-18T17:14:12Z","html_url":"https://github.com/sdroege/gst-player/pull/14#discussion_r28645729","pull_request_url":"https://api.github.com/repos/sdroege/gst-player/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/sdroege/gst-player/pulls/comments/28645729"},"html":{"href":"https://github.com/sdroege/gst-player/pull/14#discussion_r28645729"},"pull_request":{"href":"https://api.github.com/repos/sdroege/gst-player/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/sdroege/gst-player/pulls/14","id":33604777,"html_url":"https://github.com/sdroege/gst-player/pull/14","diff_url":"https://github.com/sdroege/gst-player/pull/14.diff","patch_url":"https://github.com/sdroege/gst-player/pull/14.patch","issue_url":"https://api.github.com/repos/sdroege/gst-player/issues/14","number":14,"state":"open","locked":false,"title":"mediainfo-v1","user":{"login":"codomania","id":3385272,"avatar_url":"https://avatars.githubusercontent.com/u/3385272?v=3","gravatar_id":"","url":"https://api.github.com/users/codomania","html_url":"https://github.com/codomania","followers_url":"https://api.github.com/users/codomania/followers","following_url":"https://api.github.com/users/codomania/following{/other_user}","gists_url":"https://api.github.com/users/codomania/gists{/gist_id}","starred_url":"https://api.github.com/users/codomania/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codomania/subscriptions","organizations_url":"https://api.github.com/users/codomania/orgs","repos_url":"https://api.github.com/users/codomania/repos","events_url":"https://api.github.com/users/codomania/events{/privacy}","received_events_url":"https://api.github.com/users/codomania/received_events","type":"User","site_admin":false},"body":"I have incorporated your review feedback in this commit. GstPlayerMediaInfo should be immutable now. In addition I check if pipeline prerolled state, if its prerolled then create a new GstPlayerMediaInfo object  (contain copy of all available streams) and emit this newly created GstPlayerMediaInfo object. \r\n\r\n","created_at":"2015-04-18T16:37:47Z","updated_at":"2015-04-18T17:14:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b336c43c99d5e25fac04d384b3c2be1dadcd446f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sdroege/gst-player/pulls/14/commits","review_comments_url":"https://api.github.com/repos/sdroege/gst-player/pulls/14/comments","review_comment_url":"https://api.github.com/repos/sdroege/gst-player/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sdroege/gst-player/issues/14/comments","statuses_url":"https://api.github.com/repos/sdroege/gst-player/statuses/d8a5a36c89611f7b50554c1488ec8986deb58af3","head":{"label":"codomania:mediainfo-v1","ref":"mediainfo-v1","sha":"d8a5a36c89611f7b50554c1488ec8986deb58af3","user":{"login":"codomania","id":3385272,"avatar_url":"https://avatars.githubusercontent.com/u/3385272?v=3","gravatar_id":"","url":"https://api.github.com/users/codomania","html_url":"https://github.com/codomania","followers_url":"https://api.github.com/users/codomania/followers","following_url":"https://api.github.com/users/codomania/following{/other_user}","gists_url":"https://api.github.com/users/codomania/gists{/gist_id}","starred_url":"https://api.github.com/users/codomania/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codomania/subscriptions","organizations_url":"https://api.github.com/users/codomania/orgs","repos_url":"https://api.github.com/users/codomania/repos","events_url":"https://api.github.com/users/codomania/events{/privacy}","received_events_url":"https://api.github.com/users/codomania/received_events","type":"User","site_admin":false},"repo":{"id":32486247,"name":"gst-player","full_name":"codomania/gst-player","owner":{"login":"codomania","id":3385272,"avatar_url":"https://avatars.githubusercontent.com/u/3385272?v=3","gravatar_id":"","url":"https://api.github.com/users/codomania","html_url":"https://github.com/codomania","followers_url":"https://api.github.com/users/codomania/followers","following_url":"https://api.github.com/users/codomania/following{/other_user}","gists_url":"https://api.github.com/users/codomania/gists{/gist_id}","starred_url":"https://api.github.com/users/codomania/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codomania/subscriptions","organizations_url":"https://api.github.com/users/codomania/orgs","repos_url":"https://api.github.com/users/codomania/repos","events_url":"https://api.github.com/users/codomania/events{/privacy}","received_events_url":"https://api.github.com/users/codomania/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/codomania/gst-player","description":"GStreamer Playback API","fork":true,"url":"https://api.github.com/repos/codomania/gst-player","forks_url":"https://api.github.com/repos/codomania/gst-player/forks","keys_url":"https://api.github.com/repos/codomania/gst-player/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codomania/gst-player/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codomania/gst-player/teams","hooks_url":"https://api.github.com/repos/codomania/gst-player/hooks","issue_events_url":"https://api.github.com/repos/codomania/gst-player/issues/events{/number}","events_url":"https://api.github.com/repos/codomania/gst-player/events","assignees_url":"https://api.github.com/repos/codomania/gst-player/assignees{/user}","branches_url":"https://api.github.com/repos/codomania/gst-player/branches{/branch}","tags_url":"https://api.github.com/repos/codomania/gst-player/tags","blobs_url":"https://api.github.com/repos/codomania/gst-player/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codomania/gst-player/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codomania/gst-player/git/refs{/sha}","trees_url":"https://api.github.com/repos/codomania/gst-player/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codomania/gst-player/statuses/{sha}","languages_url":"https://api.github.com/repos/codomania/gst-player/languages","stargazers_url":"https://api.github.com/repos/codomania/gst-player/stargazers","contributors_url":"https://api.github.com/repos/codomania/gst-player/contributors","subscribers_url":"https://api.github.com/repos/codomania/gst-player/subscribers","subscription_url":"https://api.github.com/repos/codomania/gst-player/subscription","commits_url":"https://api.github.com/repos/codomania/gst-player/commits{/sha}","git_commits_url":"https://api.github.com/repos/codomania/gst-player/git/commits{/sha}","comments_url":"https://api.github.com/repos/codomania/gst-player/comments{/number}","issue_comment_url":"https://api.github.com/repos/codomania/gst-player/issues/comments{/number}","contents_url":"https://api.github.com/repos/codomania/gst-player/contents/{+path}","compare_url":"https://api.github.com/repos/codomania/gst-player/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codomania/gst-player/merges","archive_url":"https://api.github.com/repos/codomania/gst-player/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codomania/gst-player/downloads","issues_url":"https://api.github.com/repos/codomania/gst-player/issues{/number}","pulls_url":"https://api.github.com/repos/codomania/gst-player/pulls{/number}","milestones_url":"https://api.github.com/repos/codomania/gst-player/milestones{/number}","notifications_url":"https://api.github.com/repos/codomania/gst-player/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codomania/gst-player/labels{/name}","releases_url":"https://api.github.com/repos/codomania/gst-player/releases{/id}","created_at":"2015-03-18T21:49:34Z","updated_at":"2015-03-20T21:16:03Z","pushed_at":"2015-04-18T16:18:53Z","git_url":"git://github.com/codomania/gst-player.git","ssh_url":"git@github.com:codomania/gst-player.git","clone_url":"https://github.com/codomania/gst-player.git","svn_url":"https://github.com/codomania/gst-player","homepage":null,"size":602,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sdroege:master","ref":"master","sha":"377fe95bcd584b7720061914c798ea52d9ec8dd9","user":{"login":"sdroege","id":301846,"avatar_url":"https://avatars.githubusercontent.com/u/301846?v=3","gravatar_id":"","url":"https://api.github.com/users/sdroege","html_url":"https://github.com/sdroege","followers_url":"https://api.github.com/users/sdroege/followers","following_url":"https://api.github.com/users/sdroege/following{/other_user}","gists_url":"https://api.github.com/users/sdroege/gists{/gist_id}","starred_url":"https://api.github.com/users/sdroege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdroege/subscriptions","organizations_url":"https://api.github.com/users/sdroege/orgs","repos_url":"https://api.github.com/users/sdroege/repos","events_url":"https://api.github.com/users/sdroege/events{/privacy}","received_events_url":"https://api.github.com/users/sdroege/received_events","type":"User","site_admin":false},"repo":{"id":22641202,"name":"gst-player","full_name":"sdroege/gst-player","owner":{"login":"sdroege","id":301846,"avatar_url":"https://avatars.githubusercontent.com/u/301846?v=3","gravatar_id":"","url":"https://api.github.com/users/sdroege","html_url":"https://github.com/sdroege","followers_url":"https://api.github.com/users/sdroege/followers","following_url":"https://api.github.com/users/sdroege/following{/other_user}","gists_url":"https://api.github.com/users/sdroege/gists{/gist_id}","starred_url":"https://api.github.com/users/sdroege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdroege/subscriptions","organizations_url":"https://api.github.com/users/sdroege/orgs","repos_url":"https://api.github.com/users/sdroege/repos","events_url":"https://api.github.com/users/sdroege/events{/privacy}","received_events_url":"https://api.github.com/users/sdroege/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sdroege/gst-player","description":"GStreamer Playback API","fork":false,"url":"https://api.github.com/repos/sdroege/gst-player","forks_url":"https://api.github.com/repos/sdroege/gst-player/forks","keys_url":"https://api.github.com/repos/sdroege/gst-player/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sdroege/gst-player/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sdroege/gst-player/teams","hooks_url":"https://api.github.com/repos/sdroege/gst-player/hooks","issue_events_url":"https://api.github.com/repos/sdroege/gst-player/issues/events{/number}","events_url":"https://api.github.com/repos/sdroege/gst-player/events","assignees_url":"https://api.github.com/repos/sdroege/gst-player/assignees{/user}","branches_url":"https://api.github.com/repos/sdroege/gst-player/branches{/branch}","tags_url":"https://api.github.com/repos/sdroege/gst-player/tags","blobs_url":"https://api.github.com/repos/sdroege/gst-player/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sdroege/gst-player/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sdroege/gst-player/git/refs{/sha}","trees_url":"https://api.github.com/repos/sdroege/gst-player/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sdroege/gst-player/statuses/{sha}","languages_url":"https://api.github.com/repos/sdroege/gst-player/languages","stargazers_url":"https://api.github.com/repos/sdroege/gst-player/stargazers","contributors_url":"https://api.github.com/repos/sdroege/gst-player/contributors","subscribers_url":"https://api.github.com/repos/sdroege/gst-player/subscribers","subscription_url":"https://api.github.com/repos/sdroege/gst-player/subscription","commits_url":"https://api.github.com/repos/sdroege/gst-player/commits{/sha}","git_commits_url":"https://api.github.com/repos/sdroege/gst-player/git/commits{/sha}","comments_url":"https://api.github.com/repos/sdroege/gst-player/comments{/number}","issue_comment_url":"https://api.github.com/repos/sdroege/gst-player/issues/comments{/number}","contents_url":"https://api.github.com/repos/sdroege/gst-player/contents/{+path}","compare_url":"https://api.github.com/repos/sdroege/gst-player/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sdroege/gst-player/merges","archive_url":"https://api.github.com/repos/sdroege/gst-player/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sdroege/gst-player/downloads","issues_url":"https://api.github.com/repos/sdroege/gst-player/issues{/number}","pulls_url":"https://api.github.com/repos/sdroege/gst-player/pulls{/number}","milestones_url":"https://api.github.com/repos/sdroege/gst-player/milestones{/number}","notifications_url":"https://api.github.com/repos/sdroege/gst-player/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sdroege/gst-player/labels{/name}","releases_url":"https://api.github.com/repos/sdroege/gst-player/releases{/id}","created_at":"2014-08-05T11:33:57Z","updated_at":"2015-04-14T13:25:18Z","pushed_at":"2015-04-18T16:37:47Z","git_url":"git://github.com/sdroege/gst-player.git","ssh_url":"git@github.com:sdroege/gst-player.git","clone_url":"https://github.com/sdroege/gst-player.git","svn_url":"https://github.com/sdroege/gst-player","homepage":null,"size":813,"stargazers_count":10,"watchers_count":10,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":4,"forks":11,"open_issues":4,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sdroege/gst-player/pulls/14"},"html":{"href":"https://github.com/sdroege/gst-player/pull/14"},"issue":{"href":"https://api.github.com/repos/sdroege/gst-player/issues/14"},"comments":{"href":"https://api.github.com/repos/sdroege/gst-player/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/sdroege/gst-player/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/sdroege/gst-player/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sdroege/gst-player/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/sdroege/gst-player/statuses/d8a5a36c89611f7b50554c1488ec8986deb58af3"}}}}